Graphql request visible in devtools?
Closed this issue · 3 comments
Can't seem to see any graphql queries in the devtools network tab.
Tested on a couple different browsers.
Do see them on other sites that use graphql, like https://iamsaravieira.com/
Please tell me I'm being stupid and forgot some supersimple thing 🙏
I don't think we make a query yet :) I was wrong , I was not aware of your changes
You called the refetch the wrong way
Thanks!
Glad I made a mistake and it's working as it should.
Not at pc with dev-things installed, will check tomorrow.
https://www.apollographql.com/docs/react/essentials/queries.html#refetching
refetch takes variables, but if we don’t pass in new variables, it will use the same ones from our previous query.
Just to confirm my understanding:
Because I passed onClick={payload.refetch}
it treated that call as a refetch with the same variables. Because there are none (so it's the same), Apollo grabbed the result from the cache and I never saw that graphql request in the console.
In the new code refetch
is being called with an empty object (which is different) and apollo does fire the graphql request.