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
When using a cache-first (default) strategy, querying for the same field in multiple fragments containing aliased fields should return results as expected.
Data should be populated. If for some reason, apollo cannot handle caching, it is skipped, or at-least an error is thrown.
Actual outcome:
Both data and error are undefined, even after loading is finished.
There are three (independent) ways to work around this —
Switch from a cache-first to network-only strategy.
Don't use the cloudAppVersion alias
Add an id in the part that queries for compatibleProducts in Fragment1 along with name
Consider a query like this which queries for
compatibleProducts
at two places —Intended outcome:
When using a
cache-first
(default) strategy, querying for the same field in multiple fragments containing aliased fields should return results as expected.Data should be populated. If for some reason, apollo cannot handle caching, it is skipped, or at-least an error is thrown.
Actual outcome:
Both
data
anderror
areundefined
, even afterloading
is finished.There are three (independent) ways to work around this —
cache-first
tonetwork-only
strategy.cloudAppVersion
aliasid
in the part that queries forcompatibleProducts
inFragment1
along withname
but having to use these would be unfortunate.
How to reproduce the issue:
https://codesandbox.io/s/apollo-graphql-cache-bug-xy97t?file=/src/index.js:0-1466
Versions
At-least 3.2.x and 3.3.x both have this issue.
The text was updated successfully, but these errors were encountered: