react-apollo-hooks icon indicating copy to clipboard operation
react-apollo-hooks copied to clipboard

Missing `setVariables` network status

Open jjenzz opened this issue 5 years ago • 4 comments

When setting new variables using useQuery, the networkStatus is always 1 (loading). This is not the case with the Query component which returns 2 (setVariables).

Example with useQuery: https://codesandbox.io/s/ox93pjm0w5 Example with Query component: https://codesandbox.io/s/3xp667vonm

It also resets data when querying an uncached query which is not desirable. See Query component example for expected behaviour which does not return to Loading... state when variables change.

jjenzz avatar Apr 11 '19 11:04 jjenzz

I think this is a dupe of #117, but the info you provided are way clearer. I wasn't aware of this networkStatus flag

FezVrasta avatar Apr 16 '19 14:04 FezVrasta

It seems the data issue is a dupe. The setVariable status is separate though.

We are having to avoid using this package for these reasons as it is not inline with current react-apollo functionality 😞

jjenzz avatar Apr 16 '19 18:04 jjenzz

I wonder if they are related, maybe the networkStatus is wrong because of some wrong command that leads to the empty data.

It looks like the queries always get called as brand new, rather than as "updated with new variables", and that may lead to these inconsistencies

FezVrasta avatar Apr 16 '19 18:04 FezVrasta

It will be fixed by #134 (which also solves #117).

trojanowski avatar Apr 18 '19 17:04 trojanowski