-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Missing AC3 documentation improvements ☔ #6711
Comments
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? |
@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. |
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 |
If anyone is interested in helping update our documentation for these different features or improvements please feel free to submit a PR. Thank you! |
Our next steps with this issue will be to:
The best way to validate these changes are still accurate and haven't been modified by a later PR would be to search our changelog by a common term, to see if we have since pushed any code that would have nullified these original changes. Alternatively you could look at the individual file changed and review the commit history. For example: #7065 was a change to support inheritance of type and field policies, according to possibleTypes. so by searching the change log with |
We decided we'll break this issue up in a few weeks where we can have low effort, medium effort and larger effort docs changes in separate issues instead of one larger issue. |
I'll work on breaking this out into separate tickets. |
This issue tracks the docs items that weren't completed in #6429.
TODO:
Overhaul https://www.apollographql.com/docs/react/data/pagination/DeprecatefetchMode
'supdateQuery
, replacing with field policies (Deprecate fetchMore updateQuery function, and provide basic field policy helper functions #6464)Explain whatkeyArgs: false
does/6852#issuecomment-674984235)
@apollo/client/core
,@apollo/client/utilities
,@apollo/client/testing
,@apollo/client/cache
, etc. entry pointsProperly explain howcache.writeQuery/Fragment
broadcasting can be silenced using thebroadcast
option (and what the advantages are to doing so - reference: Allow silencing broadcast for cache update methods. #6288) 👉 adds broadcast false details #9978Explain how to usecache.performTransaction()
to batch writes without broadcasting until they've all finished.cache.batch
(introduced in Introduce new cache.batch(options) method for InMemoryCache. #7819) provides a better API and essentially wrapsperformTransaction
, so it’s the one we should recommend people use. 👉 Cache.batch docs #9987Documentmerge: false
(e.g. Warn when clobbering non-normalized data in the cache. #6372 (comment)) 👉 Field policy merge docs #9969DocumentuseReactiveVar
(Implement useReactiveVar hook for consuming reactive variables in React components. #6867) 👉 Use reactive var hook #9906Document type policy inheritance, usingpossibleTypes
(Support inheritance of typePolicies, according to possibleTypes. #7065) 👉 Type policy inheritance #9905Document custom merge function support in type policies (Allow custom merge functions (including merge:true and merge:false) in type policies. #7070)Explain how to properly test local state usingMockedProvider
, by passing a configuredcache
intoMockedProvider
itself (MockedProvider not returning data when @client is specified #4532)PR
Mockprovider docs updates #9867Remove deprecated language from dataIdFromObject Remove deprecated language fromdataIdFromObject
#9817MyQueryInterface
(typescript): Request for adding different types(interfaces) for the query data from useQuery and subscribeToMore data #9946InMemoryCache
to support using...FragmentName
in queries without redeclaringFragmentName
in every query #9764defaultDataIdFromObject
normalize objects with nullish ids #9862The text was updated successfully, but these errors were encountered: