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
We want to use the standby fetch policy to call our API only when we use refetch.
The problem is that the loading field of ApolloQueryResult is true before any HTTP call. The issue was discussed here : #7564, but the solution is to use useLazyQuery which is not available for apollo-angular.
I don't understand why the field loading is initialized to true if there is no loading yet ?
As far as I understand it, standby was added at some point to enable the skip use case of useQuery, but no additional networkStatus was added for it - instead, the networkStatus with "no data and no error" was used for it - loading.
The React hooks work around that outside the core as you can see here:
This is something that - while confusing - could break a lot of apps if we were to change it. I'll bring it up internally, but short-term I have little hope that we can change it.
Your best bet is probably to work around it in a similar fashion for now.
Issue Description
We want to use the
standby
fetch policy to call our API only when we use refetch.The problem is that the
loading
field ofApolloQueryResult
is true before any HTTP call. The issue was discussed here : #7564, but the solution is to useuseLazyQuery
which is not available forapollo-angular
.I don't understand why the field loading is initialized to true if there is no loading yet ?
Link to Reproduction
https://github.com/viico/apollo-fetch-policy-standby-loading
Reproduction Steps
We create a repo for reproduction here : https://github.com/viico/apollo-fetch-policy-standby-loading.
When you start the angular application you will see that there is no HTTP request before we refetch (that's ok) but the loading field is true anyway.
@apollo/client
version3.0.0
The text was updated successfully, but these errors were encountered: