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
Summary:
Because of performance problems with the InMemoryCache, I tried to migrate our app to the hermes cache. Since cache initialization was done via writeData before I changed it to use writeFragment.
So the init function would look something like:
constinitCache=cache=>{letfragmentString=gql` fragment test on MyType { ...myTypeFragment }${fragments.myTypeFragment}`;letfragment={id: "myType",fragment: fragmentString,fragmentName: "test"data: {__typename: "MyType",
...
}};cache.writeFragment(fragment);
The used fragment is part of a collection of fragments and has the following structure:
constfragments={myType: gql` fragment myTypeFragment on myType { __typename, ... `,
...
}
Using the Apollo dev tools, I can see the following entries getting created in the cache:
I expected to see a logging message containing the data from the myType entry in the cache. Executing this query within GraphiQL should also produce this result
Actual Behavior:
Instead, onCompleted is never called. Executing the query within GraphiQL returns
{
"data": {
"myType": null
}
}
System Information
OS:
Linux 5.0 Ubuntu 19.04 (Disco Dingo)
Binaries:
Node: 13.5.0 - /usr/local/bin/node
npm: 6.13.4 - /usr/local/bin/npm
Browsers:
Firefox: 71.0
npmPackages:
@apollo/react-hooks: 3.1.3 => 3.1.3
apollo-cache-hermes: ^0.8.10 => 0.8.10
apollo-cache-inmemory: ^1.6.5 => 1.6.5
apollo-client: ^2.6.8 => 2.6.8
apollo-link: ^1.2.13 => 1.2.13
apollo-link-error: ^1.1.12 => 1.1.12
apollo-link-http: ^1.5.16 => 1.5.16
react-apollo: 3.1.3 => 3.1.3
The text was updated successfully, but these errors were encountered:
Summary:
Because of performance problems with the InMemoryCache, I tried to migrate our app to the hermes cache. Since cache initialization was done via
writeData
before I changed it to usewriteFragment
.So the init function would look something like:
The used fragment is part of a collection of fragments and has the following structure:
Using the Apollo dev tools, I can see the following entries getting created in the cache:
The
myType
entry looks fine, but theROOT_QUERY
entry is alwaysnull
. There does not seem to be any reference between them either.Expected Behavior:
Using
with
I expected to see a logging message containing the data from the
myType
entry in the cache. Executing this query within GraphiQL should also produce this resultActual Behavior:
Instead,
onCompleted
is never called. Executing the query within GraphiQL returnsSystem Information
The text was updated successfully, but these errors were encountered: