Computer Science, asked by alexadsouza8286, 1 year ago

The application attempted to write an object with no provided typename but the store already contains an object with typename

Answers

Answered by Ak5555
1
The fix is quite easy, just add id to the query without id.
So the question is: should every query has defined id for a resource?
It seems to work without id but when there will be the next query with defined id, this error appears.
I'm asking because I have a few other cases where external API doesn't have id so this problem can appear again in the future.
Intended outcome:
Error shouldn't appear and application should render data.
Actual outcome:
Error appears
Network error: Error writing result to store for query query PokemonQuery($id: ID) { Pokemon(id: $id) { name url createdAt } } Store error: the application attempted to write an object with no provided id but the store already contains an id of Pokemon:ciwnmyvxn94uo0161477dicbm for this object.
How to reproduce the issue:
https://codesandbox.io/s/mom8ozyy9
Check checkbox in provided demo.
Similar questions