Skip to content
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

Correct network response but incorrect data object #215

Open
Kelbie opened this issue Oct 26, 2019 · 2 comments
Open

Correct network response but incorrect data object #215

Kelbie opened this issue Oct 26, 2019 · 2 comments

Comments

@Kelbie
Copy link

Kelbie commented Oct 26, 2019

Screenshot 2019-10-26 at 16 04 01

There seems to be a problem with react-apollo-hooks in that the response is correct but when I print out the data object in useQuery its incorrect. Anyone any clues as to how to fix this?

@Kelbie
Copy link
Author

Kelbie commented Oct 26, 2019

I found the issue. Its because they all had the same id so react-apollo-hooks must assume its the same object when they are not. I think this should be fixed as its not something that happens using other graphql tools.

@ghost
Copy link

ghost commented Nov 14, 2019

Maybe the best way is to create a unique identifier (uuid) based on depth of you results, index, and id from your backend and then config your inMemoryCache. Like this you can keep your id field for some operation and keep the mechanism of auto caching of your apollo client.

Or you can disable caching for this query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant