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
I am trying to figure out why queries that are executed directly on the ApolloClient with .query do not appear in apollo-client-devtools. Well they do appear, but only temporarily.
When composing a graphql query on a component you get the following actions
APOLLO_QUERY_INIT
APOLLO_QUERY_RESULT
However when executing a query directly using the client (i.e. my case I am using withApollo to pass client to my component) you get the following actions
Queries with the latter actions seems to have their result removed from the store once retrieved. So you actually see it pop up in the devtools, but then it disappears.
Devling into the apollo-client and react-apollo it seems that composed components use
return this.queryManager.watchQuery<T>(options);
whereas withApollo uses
return this.queryManager.query<T>(options);
From my understanding query seems to remove/stop the query once it's completed. This seems to be governed by shouldSubscribe - found here. I am still not 100% sure how. The codes jumps around quite a bit. It would be great if someone could point me to some documentation or explain how ObservableQueries work in the context of the apollo-client. It seems the term subscribe is used quite a bit, but I feel like this is different from the conventional subscription people refer to in apollo. I couldn't quite link it to everything.
I am trying to get into the library so I can contribute more. Any help here would be appreciated.
In the end I would like withApollo queries to appear in the apollo-client-devtools.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Migrated from: #40
I am trying to figure out why queries that are executed directly on the ApolloClient with
.query
do not appear in apollo-client-devtools. Well they do appear, but only temporarily.When composing a graphql query on a component you get the following actions
However when executing a query directly using the client (i.e. my case I am using withApollo to pass client to my component) you get the following actions
Queries with the latter actions seems to have their result removed from the store once retrieved. So you actually see it pop up in the devtools, but then it disappears.
Devling into the apollo-client and react-apollo it seems that composed components use
whereas withApollo uses
From my understanding
query
seems to remove/stop the query once it's completed. This seems to be governed byshouldSubscribe
- found here. I am still not 100% sure how. The codes jumps around quite a bit. It would be great if someone could point me to some documentation or explain how ObservableQueries work in the context of the apollo-client. It seems the term subscribe is used quite a bit, but I feel like this is different from the conventional subscription people refer to in apollo. I couldn't quite link it to everything.I am trying to get into the library so I can contribute more. Any help here would be appreciated.
In the end I would like withApollo queries to appear in the apollo-client-devtools.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions