refactor(contentful): move operations onto cacheable typed fields AD-476 - #7259
Merged
Merged
Conversation
donationData.graphql had no importers. AD-476
The deprecated contentful.entry and contentful.entries fields return the untyped JSONObject scalar, so no Stellate cache rule could match them and every Contentful response passed through uncached. The operations now select searchEntries and searchPreviewEntries, which return ContentfulEntryCollection and fall under the existing cacheLongTerm rule. Readers unwrap the ContentfulEntry envelope through a shared getContentfulEntries helper, and the two documents supporting preview select both fields behind `@skip`/`@include`. AD-476
mcstover
approved these changes
Sep 15, 2026
eddieferrer
approved these changes
Sep 15, 2026
dyersituations
approved these changes
Sep 15, 2026
Collaborator
|
🎉 This PR is included in version 3.95.0-rc.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Collaborator
|
🎉 This PR is included in version 3.95.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Every Contentful response this app fetches today passes through Stellate uncached. Stellate caches by GraphQL type, but the
contentful.entriesandcontentful.entryfields return the untypedJSONObjectscalar, so no rule can match them.ContentfulEntryandContentfulEntryCollectionhave acacheLongTermrule in stellate-config, so using thecontentful.searchEntriesandcontentful.entryByIdfields that return those types allows the requests to be cached.What changed
Every Contentful operation now selects the typed replacements.
entries(…)becomessearchEntries(…), withsearchPreviewEntriesfor preview mode, and the search arguments carry over unchanged. That covers:src/graphql/queryGlobalPromoFragmentbehind the promo banner and footer disclaimersThe two queries that declare
$preview,contentfulEntries.graphqlandlenderProfileBadgeData.graphql, declare it asBoolean = falseand select both the published and the preview field behind@skip/@include.Responses shift one level.
items[n]is now aContentfulEntrywrapper, so readers go throughitems[n].entry. A newgetContentfulEntrieshelper incontentfulUtils.jsdoes that unwrapping, prefers the preview collection when present, and drops null entries. The readers that used to reach intocontentful.entries.itemscall it instead, and the remaining aliased reads unwrap inline. The helper has its own spec.I deleted
checkout/donationData.graphql, which had no importers.This has been verified locally against the staging environment. See the ticket for more details and QA steps https://kiva.atlassian.net/browse/AD-476