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

Documentation for custom FieldPolicy read and merge functions. #5677

Merged
merged 10 commits into from
Jan 29, 2020

Conversation

benjamn
Copy link
Member

@benjamn benjamn commented Dec 12, 2019

Now that we are finally firming up these APIs, after extensive research, experimentation, and subjective evaluation, I feel comfortable beginning to document them properly.

@benjamn

This comment has been minimized.

@benjamn benjamn changed the base branch from storage-and-invalidation-for-read-functions to release-3.0 December 13, 2019 17:18
@benjamn benjamn force-pushed the docs-for-custom-read-and-merge-functions branch from 273b30d to 0f8cf03 Compare December 13, 2019 20:08
Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

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

So far so great @benjamn! Super clear and easy to follow 👍.

@benjamn benjamn force-pushed the docs-for-custom-read-and-merge-functions branch from 0ebaf8d to c4625dd Compare January 3, 2020 15:08
@hwillson hwillson changed the base branch from release-3.0 to master January 7, 2020 17:47
@benjamn benjamn force-pushed the docs-for-custom-read-and-merge-functions branch 2 times, most recently from 933528f to 829f399 Compare January 21, 2020 17:47
benjamn added a commit that referenced this pull request Jan 23, 2020
One consequence of #5603 is that replacing non-normalized data in the
cache can result in loss of useful data. In almost every case, the right
solution is to make sure the data can be normalized, or (if that isn't
possible) to define a custom merge function for the replaced field, within
the parent TypePolicy.

It turns out we can give a very detailed warning in all such situations,
so that's what this commit does. Looking at the output for our test suite,
every warning is legitimate and worth fixing. I will resolve the warnings
and test failures that our test suite generates in subsequent commits.

TODO Update the documentation URLs after #5677 is merged.
@benjamn benjamn force-pushed the docs-for-custom-read-and-merge-functions branch from 7e66008 to 48fc3ba Compare January 29, 2020 22:57
@benjamn benjamn merged commit 7f47eeb into master Jan 29, 2020
@benjamn benjamn deleted the docs-for-custom-read-and-merge-functions branch January 29, 2020 22:59
benjamn added a commit that referenced this pull request Jan 30, 2020
Follow-up to #5677.

Thanks to @tafelito for actually trying out the code examples in the new
cache policies documentation!
@apollographql apollographql locked and limited conversation to collaborators Feb 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants