Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache mutation nullability bug #2751

Merged
merged 8 commits into from
Jan 5, 2023
Merged

Conversation

AnthonyMDev
Copy link
Contributor

Closes #2697

This PR:

  • Adds a handler to the GraphQLAccumulator protocol for accepting values that are expected to exist but are not in the JSON object.
  • The SelectionSetMapper accumulator now has options for maintaining null values instead of stripping them out and allowing missing values to be accepted for optional fields.
    • These are used when reading cache values onto a mutable selection set for cache updates, to maintain existing null values and allowing updates to cache objects that are currently incomplete.

Future work to allow fields from cache mutations to be cleared out is enabled by this PR as well.

@netlify
Copy link

netlify bot commented Jan 4, 2023

Deploy Preview for apollo-ios-docs canceled.

Name Link
🔨 Latest commit def06cf
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docs/deploys/63b5e21c5109fc0008d05610

Copy link
Member

@calvincestari calvincestari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thanks!

@AnthonyMDev AnthonyMDev merged commit 618f336 into main Jan 5, 2023
@AnthonyMDev AnthonyMDev deleted the cache-mutation-nullability-bug branch January 5, 2023 18:47
@calvincestari calvincestari mentioned this pull request Jan 10, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants