Disclaimer: I’m new to GraphQL so I’m looking for advice from experts.
In my React application, I do the following:
- Retrieve some variations of a
Personobject all over the application, through slightly different queries.
- The object always contains a list of
- In one component, I create a new
Tagand apply it via a mutation to a specific
Person. Now the
Person, in the back-end contains an extra tag in its Tags list.
Home page: queryPersonsWithSomeTags
Home page: queryAllTags
Person page: queryPersonWithAllTags
Another page: queryTagsThatBelongsToListOfPersons
Another page: mutationCreateTag
Another page: mutationApplyTagToListOfPersons
Another page, I use the mutation’s
mutationApplyTagToListOfPersons “update” function to update Apollo’s cache but that is not scalable as I need to update the cache of every single query that returned the tag object.
Is updating the cache of various queries expected or it is most likely a misuse of the library or a mis-design of the application/queries where this case should not happen?
Thanks for the help and for the great library!