apollo-client-devtools icon indicating copy to clipboard operation
apollo-client-devtools copied to clipboard

Is client.query() supposed to log the query in the Chrome Extension

Open phbou72 opened this issue 4 years ago • 6 comments

Intended outcome: Hi, so for performance reason and also because it's not a good practice with hooks to use them in a forEach I'm using client.query directly to query graphql and get a promise for each query I'm bundling together in a Promise.all(). I'm expecting the query info to show in the extension panel.

Actual outcome: The query infos doesn't show in either in the queries tab nor the cache tab. However they are correctly executed and can get the data. I know the extension work correctly with hooks because I have some working correctly.

How to reproduce the issue: Using this method to setup a query client : https://www.apollographql.com/docs/react/get-started/#create-a-client

Desktop (please complete the following information):

  • OS: Mac OS X
  • Browser: Chrome
  • Browser version: 91
  • Extension version 3.0.5

phbou72 avatar May 30 '21 17:05 phbou72

After watching carefully the tools, I think it add them but they disappear after a short time.

phbou72 avatar Jun 07 '21 19:06 phbou72

I have the same question!

My team has an old setup and we are not using hooks. We directly query using the exported apollo client. I noticed that Queries tab in the dev tools only shows the fired queries momentarily.

Is this an expected behaviour?

techimist avatar Jun 11 '21 15:06 techimist

That doesn't sound like expected behaviour. We'll take a look - thanks!

hwillson avatar Aug 13 '21 16:08 hwillson

The problem also happen when using the useClient() hooks to query.

phbou72 avatar Aug 15 '21 22:08 phbou72

Issue still persists, apolloClient.query() calls for example disappear from active queries after a short duration.

Oikio avatar May 24 '22 14:05 Oikio

Is this the opposite of #815 ?

The wording "active queries" makes me think that it should NOT show one-shot queries that aren't watching for changes on an ongoing basis, but...

egnor avatar Jan 03 '23 01:01 egnor