This issue tracks the docs items that weren't completed in https://github.com/apollographql/apollo-client/pull/6429.
TODO:
fetchMode
's updateQuery
, replacing with field policies (https://github.com/apollographql/apollo-client/pull/6464)keyArgs: false
doesclient.cache.policies.addTypePolicies(typePolicies)
@apollo/client/core
, @apollo/client/utilities
, @apollo/client/testing
, @apollo/client/cache
, etc. entry pointsconsole.log
warnings, what they mean, how to resolve themcache-first
after cache-and-network
or network-only
(8ce2b4f7c8e631a46ed41cd205c34ede38f202c9)read
/ merge
docs to make sure they reflect the final version of the APIcache.modify
with a readQuery
/ writeQuery
approach instead (then briefly mention cache.modify
as a more advanced alternativecache.writeQuery/Fragment
broadcasting can be silenced using the broadcast
option (and what the advantages are to doing so - reference: https://github.com/apollographql/apollo-client/pull/6288)cache.performTransaction()
to batch writes without broadcasting until they've all finishedmerge: false
(e.g. https://github.com/apollographql/apollo-client/pull/6372#issuecomment-670593650)useReactiveVar
(https://github.com/apollographql/apollo-client/pull/6867)possibleTypes
(https://github.com/apollographql/apollo-client/pull/7065)MockedProvider
, by passing a configured cache
into MockedProvider
itself (https://github.com/apollographql/apollo-client/issues/4532)If anyone notices other AC3 docs items that are wrong/missing, please let us know. Thanks!
Would be good to get some more clarification around testing especially around client directives and reactive variables.
Meanwhile where we can find information about pagination? Thanks!
@abdonrd We're working on overhauling the main pagination section of the docs, but in the meantime you can find some details here: https://www.apollographql.com/docs/react/caching/cache-field-behavior/#handling-pagination
Regardless of whether #6619 is a bug or intended behavior, this comment indicates a section of the documentation that could use some love to clarify intention WRT merging variables on mutate calls. Similarly, information about the change (if intentional) should also be conveyed in migration guides, changelogs, etc.
I'm looking for documentation for local-only mutations. I see there's still a checkbox missing with the mutation example, but if someone could explain to me what I'm doing wrong, that would be great.
Our application makes use of the old local resolvers. Now I want to 'update' them to typePolicies. My old resolver looked like:
resolvers: {
....
Mutation: {
createCategorie(...)
}
}
Now I changed it to this typePolicy:
const inMemoryCache = new InMemoryCache({
typePolicies: {
Query: {
fields: {
....
},
},
Mutation: {
fields: {
createCategorie(...) {
console.log('in create');
}
}
},
...
the mutation gets called like this:
gql`
mutation createCategorie(...) {
createCategorie(...) @client
}`,
However the console.log never gets called. Is there something I'm missing?
edit: found my answer here: https://spectrum.chat/apollo/apollo-client/ac3-client-mutation~a0f064bf-731b-4129-8016-601217d45971
I think this issue about undefined old data when loading new data could use some love in the documentation / migration guides too.
@JesseZomer I've stuck with the same problem. Probably you can help me with migration from local resolver mutation -> reactive variable?
Another problem related to this issue: https://github.com/apollographql/apollo-client/issues/6247 and comment https://github.com/apollographql/apollo-client/issues/6711#issuecomment-671838312
@dmitry I didn't migrate from local mutation resolvers to reactive variables, but I threw away the local mutations and just did direct cache updates with read/writeQuery.
@apollo/client/core, @apollo/client/utilities, @apollo/client/testing, @apollo/client/cache, etc. entry points
Also link entry points. These imports are out of date: https://www.apollographql.com/docs/link/
Example with apollo cache reset to initial state also needs to be updated because it uses deprecated apollo-link-state
to write defaults
Most helpful comment
Would be good to get some more clarification around testing especially around client directives and reactive variables.