You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that when I start my app I don't have any ROOT_QUERY. So that whatever is in my query,store.readQuery({query}); throws "Can't find field on object (ROOT_QUERY) undefined."
Running store.writeQuery({query, data}}) creates ROOT_QUERY and the same readQuery call works afterwards.
Is this a bug or should I have used initStore ?
The text was updated successfully, but these errors were encountered:
Hi @darkship If any of the data that readStore tries to read is not there, the function will throw an error. In your case there's nothing in the store at all, which is why it errors at ROOT_QUERY. You should protect the readStore call with a try/catch block if it's possible that the data might not be in the store yet.
Hi,
I came across an issue like this #1701.
It appears that when I start my app I don't have any ROOT_QUERY. So that whatever is in my query,
store.readQuery({query});
throws "Can't find field on object (ROOT_QUERY) undefined."Running
store.writeQuery({query, data}})
creates ROOT_QUERY and the samereadQuery
call works afterwards.Is this a bug or should I have used
initStore
?The text was updated successfully, but these errors were encountered: