-
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
Missing field error from writeToStore.js in v2.5 #4419
Comments
Missing field
error from writeToStore.js
in v2.5
I get this warning after upgrading to 2.5 with: export const USER_QUERY = gql`
query UserQuery {
currentUser {
id
firstName
}
loginInProgress @client
}
` My app makes this query on render, and the user isn't logged in, so
And when I'm logged in, I get this:
|
@lorensr Have you set up a resolver for the loginInProgress query? |
No. Adding one removes the warning. resolvers: {
Query: {
loginInProgress: () => false
}
} So the question is: is this intended behavior? Migration guide didn't mention the need for it: https://www.apollographql.com/docs/react/essentials/local-state.html#migrating |
I'm pretty sure that's how you were supposed to use it with apollo-link-state. Not sure why you weren't getting that error before |
@hwillson I'm not longer able to reproduce this after upgrading to 2.5 so I'll close this |
Intended outcome:
I expected that
cache.writeData()
would change the client's cache.Actual outcome:
I got a
Missing field
error fromwriteToStore.js
.How to reproduce the issue:
I was not able to reproduce this in the error-template. But here's what i have in my local setup
This is how i've set up the cache defaults
If i try to write to the cache afterwards like so:
I get the error.
I normally wouldn't bother you with a bug that can't be reproduced, but seeing as how the packages are in beta i thought you might find the information useful
Versions
The text was updated successfully, but these errors were encountered: