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
If a mutation like createOrder($placeId: ID!) returns different orders every time, the new one will overwrite the old in the cache. This can lead to incorrect mutations results for reactive clients like graphql/client.dart and probably ferry as well: zino-hofmann/graphql-flutter#774 (comment).
I'm not sure what the best solution is, or if it is even an issue for normalize to solve itself.
The text was updated successfully, but these errors were encountered:
Let me know if you think of a way around this, but it seems like the existing behavior is the expected behavior, even if it results in incorrect mutation results in some cases.
This should probably be addressed by simply not reading mutation results from the cache by default. In ferry, mutations use FetchPolicy.NetworkOnly by default, and the FetchPolicy is not coupled to reactivity.
If a user needs to use cached mutation results, they could use unique variables or define custom FieldPolicy read / merge functions to alter the default behavior.
Ok – yeah that's kind of what I was leaning towards also. I think the real problem is the use of cacheAndNetwork due to the entanglement of ObservableQuery in graphql/client.dart
If a mutation like
createOrder($placeId: ID!)
returns different orders every time, the new one will overwrite the old in the cache. This can lead to incorrect mutations results for reactive clients likegraphql/client.dart
and probablyferry
as well: zino-hofmann/graphql-flutter#774 (comment).I'm not sure what the best solution is, or if it is even an issue for
normalize
to solve itself.The text was updated successfully, but these errors were encountered: