-
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
cache.modify() not a function #6208
Comments
Please note that https://www.apollographql.com/docs/react/data/mutations/ still refers to |
Here is still reference to |
I'm getting this error on the latest |
I'm seeing it in
|
Aye I'm seeing this in 3.2.7. I'm reasonably new to Apollo and while lots of the docs are great, I' just so confused about how cache updates are meant to be done without |
Seeing the error as well in |
I was having this problem because I had accidentally installed apollo-client instead of @apollo/client . |
@benjamn still seeing this in
Looks to be something in here apollo-client/src/core/QueryInfo.ts Lines 38 to 49 in 911a19a
as this is some logging I'm doing prior to that happening
|
Also see it in |
My current project is having the same problem ( That is, this is fine:
but this fails:
|
In case it may help anyone, this is what fixed it for me:
|
Hello,
I have a problem with cache.modify() when trying to update the cache in a resolver with the v.3.0 beta @apollo/client version.
The chrome browser tells me that modify() is not a function:
cache.identify is working.
Here is my code :
`export const resolvers: any = {
Mutation: {
updateApplicationProofUrl: (__:any, {input}:any, {cache, getCacheKey}:any) => {
const {jobId, signedGetUrl} = input
const id = cache.identify({
__typename: 'Job',
id: jobId
})
console.log('id', id)
cache.modify(id, {applicationProofUrl: signedGetUrl})
}
},
}`
Note : cache.identify() is working.
My cache is configured with this
// Graphql default state const cache = new InMemoryCache(); const link = new HttpLink({ uri: "http://localhost:5001" }) // GraphqlClient const client = new ApolloClient<NormalizedCacheObject>({ link, cache, typeDefs, resolvers, connectToDevTools: true })
Do you have an idea of the problem ?
It's my first ever issue posting on any library so if it misses some info, don't hesitate to tell me.
Thank you for your help !
The text was updated successfully, but these errors were encountered: