-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Context
We are using the resolveResponse function in our project, and have recently added the removeUnresolved option to filter out draft or otherwise unresolvable content. After enabling this option, a number of our tests began failing due to contentType being undefined for certain entries. Upon investigating the Contentful JS SDK's implementation, we discovered the itemEntryPoints option, which resolved some failures when set as follows:
resolveResponse(response, { removeUnresolved: true, itemEntryPoints: ['fields'] })However, we are still experiencing an issue where the removeUnresolved option removes the contentType from Embedded Entries fields. Here's a screenshot demonstrating the error within a failed test:
Expected Behavior
- When using
removeUnresolved: true, we expect only truly unresolvable or draft entries to be removed. - Embedded Entries should retain their
contentTypeproperty as long as they are resolvable. - The response shape should remain compatible with downstream consumers that expect
contentTypeto be present.
Observed Behavior
- With
removeUnresolved: true, Embedded Entries lose theircontentTypeproperty. - This results in TypeScript errors and downstream issues in our application, as we rely on the presence of
contentTypefor type-checking and rendering logic. - Setting
itemEntryPoints: ['fields']helps with some cases but does not resolve the issue for Embedded Entries.
Steps to Reproduce
- Use
resolveResponsewith a response containing RichText fields that embed other entries. - Enable
removeUnresolved: trueand optionally setitemEntryPoints: ['fields']. - Observe that Embedded Entries lose their
contentTypeproperty.
Metadata
Metadata
Assignees
Labels
No labels