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
Intended outcome:
When using Fragment on Query warning is not shown and query is executed.
Actual outcome:
When I use query including Fragment defined on Query, HeuristicFragmentMatcher fails on checking the store as ROOT_QUERY doesn't contain __typename.
As roots are not appended with __typename (Don't add fields to the root mutation/query #463) what ends up in cache is this: {"data":{"configs":[{"id":"SOME_ID","data":"SOME_DATA","__typename":"Config"}]}}. Data have its __typename however as expected, ROOT_QUERY doesn't.
Secondly, let's make query containing some fragment. In my case:
query SomeQuery {
...EnumsFragment
}
fragment EnumsFragment on Query {
supportedOptions {
name
}
}
Now in this very exact moment the warning happens (attached stacktrace) and the query is prevented from being sent to server. When debugging the issue what I have found out:
Fragment matcher is called by readFromStore.js#153
Intended outcome:
When using
Fragment
onQuery
warning is not shown and query is executed.Actual outcome:
When I use query including
Fragment
defined onQuery
,HeuristicFragmentMatcher
fails on checking the store asROOT_QUERY
doesn't contain__typename
.Stacktrace: https://gist.github.com/dulakm/6ee9d6afb7a730a38bab714875bd3540
How to reproduce the issue:
__typename
(Don't add fields to the root mutation/query #463) what ends up in cache is this:{"data":{"configs":[{"id":"SOME_ID","data":"SOME_DATA","__typename":"Config"}]}}
. Data have its__typename
however as expected,ROOT_QUERY
doesn't.readFromStore.js#153
fragmentMatcher.js#13
gets object which is in factROOT_QUERY
(the one from step 1.)14
and17
20
it is affirmed thatROOT_QUERY
doesn't contain__typename
and warning is thrown.Versions
The text was updated successfully, but these errors were encountered: