You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to upgrade graphql-sequelize to the latest version (using DataLoaders). I have a problem, especially in tests (but can happen in normal cases), where the DataLoader is cached, so the result of the Mutation doesn't show up in future queries.
For example:
do a GraphQL query, which triggers something that gets cached in a DataLoader
do a mutation that affects some data in that query's results
in the output of the mutation, the same DataLoader from step 1 (and step 2) is used, thereby returning stale data. The data was updated in step 2, but the DataLoader still has it cached.
I think we need to call resetCache on dataloader-sequelize each time a new Query/Mutation is issued. But then we also need to call resetCache after any mutation (before it returns any output).
The text was updated successfully, but these errors were encountered:
So do I understand correctly that the suggested resolution to stale versions of objects being returned from the cache after an update is to disable the dataloader-sequelize always in the resolveroptions? Or is this in conjunction with some fixes to dataloader-sequelize?
I'm having this same issue but want to continue to benefit from dataload-sequelize for Queries.
I'm trying to upgrade
graphql-sequelize
to the latest version (using DataLoaders). I have a problem, especially in tests (but can happen in normal cases), where the DataLoader is cached, so the result of the Mutation doesn't show up in future queries.For example:
I think we need to call
resetCache
ondataloader-sequelize
each time a new Query/Mutation is issued. But then we also need to callresetCache
after any mutation (before it returns any output).The text was updated successfully, but these errors were encountered: