My Setup
- Typescript React App
- Backend GraphQL API
- Apollo Client
- Inspecting with Apollo Client Devtools Extension
My question
- What are active queries? The Apollo Docs talks about active queries a lot but I am struggling to get an actual definition.
- I understood that an active query is basically a link from your component state to the overall global state of the Apollo Client cache. Is this correct?
- Why do I see 2 queries being listed when I only have one query in my react component (see screen recording). For example in my events pages I call on query
listEvents
but then I see that query appear twice in my active queries when I load the page. Is seems to be the same for any new query. - Why do my active queries keep increasing when I am just navigating back and forth between the same pages and fetching the same data. Based on my understanding, I would expect the number of active queries not to increase in this case as I am not introducing and new queries.
- I am worried that there is some issue in my setup leading to new active queries being created instead of 'recycling' existing ones. Am I right? And if so how can I debug/fix this?
Thanks,