-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sudden error: Encountered a sub-selection on the query, but the store doesn't have \ an object reference #4125
Comments
I got the same problem. My app always worked until I reinstalled everything today. Running
|
I saw this problem today after nuking
|
I solved it by using inmemorycache instead of my Redux Cache
|
I have also locked the version to [email protected] |
My code was already using InMemoryCache, however the error persists when using apollo-utilities with version 1.0.24 + |
I don't know, but nice find @soniachan! |
I can confirm the problem exists since |
Hey guys, ran into the same bug over here. Seemingly out of nowhere. Based on @rajit and @soniachan comments we experimented with adding |
we are also experiencing this issue. we recently nuked our node_modules and re-installed our packages. some packages ended up being resolved differently than they used to. this eventually introduced this current issue. with all the apollo + graphql packages we are using, and all the internal dependencies that they bring, we really found ourselves in a pickle. We tried a bunch of tricks to no avail, including re-evaluating all of our dependencies, and yarn resolutions. We'd be very grateful for anyone who'd offer some help here. FYI, here are the package versions we're using: apollo-cache-inmemory": "1.1.11", |
@sacummings91 tip helped
|
My problem was solved, thank you. |
Moving from 1.2 to 1.3 solved the issue. For those who still use npm: |
Props to Alecia for tracking down the discussion about: "Encountered a sub-selection on the query, but the store doesn't have an object reference.": apollographql/apollo-client#4125 We weren't directly using apollo-cache-inmemory, which was the workaround suggested here. But we were using older versions of apollo-boost, from which we were getting the InMemoryCache object. They have probably updated since.
I am also suddenly seeing this problem with [email protected]. I cannot easily upgrade to 1.3.0+ because doing so breaks rendering of updates after mutations in my application. But I suddenly can't run any unit tests that use
|
I'm going to close this issue since it hasn't received a lot of traction recently and seems to be fixed by a new version. It sounds like upgrading to the latest release is the best way to resolve this, though of course the feasibility of doing that upgrade is project specific. If this is still a problem, we welcome anyone who is experiencing the problem (or anyone who comes across this issue and is able to assist) to build a reproduction of the problem into a runnable CodeSandbox reproduction](https://codesandbox.io/), using the latest versions of the appropriate packages, and sharing the link to that reproduction in this issue. I'm happy to re-open if this is still occurring and someone can provide a reproduction, though a new issue which references this issue is probably best. Thanks! |
I have fixed this bug in npm install --save @codejamninja/apollo-cache-redux import { ReduxCache, apolloReducer } from '@codejamninja/apollo-cache-redux'; https://github.com/codejamninja/apollo-cache-redux This fixes the following issues |
The following error was hit suddenly since around 10 days ago..
A simple mutation and refetchQuery was made
this.apollo.mutate({ mutation: GraphQL.Mutation.updateAccount, refetchQueries: [{ query: GraphQL.Query.accountQuery, variables: { filter: this.account.id, } }], variables: { accountId: this.account.id } })
Does anyone have any idea to fix this error?
My inmemorycache was set with
cache: new InMemoryCache({ dataIdFromObject: object => object['id'] || defaultDataIdFromObject(object) })
The text was updated successfully, but these errors were encountered: