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

Variables don't display for queries

Open afrankel-sfdo opened this issue 4 years ago • 13 comments

Intended outcome:

Any variables executed in a query should show in the active queries inspector.

Actual outcome:

Variables are always empty for queries. Mutations are fine.

How to reproduce the issue:

Network tab

{"operationName":"brandSettings","variables":{"id":123123},"query":"query brandSettings($id: Int!) {\n  organization(id: $id) {\n    id\n    orgSettings {\n      defaultLocale\n      __typename\n    }\n    brandSettings {\n      communityLogo\n      footerContent1\n      footerContent2\n      footerContent3\n      primaryColor\n      secondaryColor\n      localized {\n        language\n        communityLogo\n        footerContent1\n        footerContent2\n        footerContent3\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n"}

Apollo dev tools

Screen Shot 2021-04-26 at 9 26 44 AM

Issue

network request shows variables":{"id":123123} but Apollo has root: {} 0 keys

Desktop

  • OS: macOS
  • Browser: Chrome 90.0.4430.85
  • Extension version: 3.0.4
  • Apollo client v2

afrankel-sfdo avatar Apr 26 '21 15:04 afrankel-sfdo

@afrankel-sfdo I haven't been able to re-create this. Any chance you (or anyone else) could provide a reproduction (tested against 3.0.5)?

hwillson avatar Apr 30 '21 09:04 hwillson

@afrankel-sfdo I haven't been able to re-create this. Any chance you (or anyone else) could provide a reproduction (tested against 3.0.5)?

@hwillson is there an easy way to setup a public example apollo client/server app? My test case is private.

afrankel-sfdo avatar May 03 '21 15:05 afrankel-sfdo

Hi! First of all, thanks and good job releasing 3.0.5 @hwillson 🎉

Regarding this issue with query variables - I'm able to reproduce it too. I'm using the same client setup I used in https://github.com/apollographql/apollo-client-devtools/issues/462 if it gives any help.

jeffstedt avatar May 06 '21 08:05 jeffstedt

I have a similar issue.

https://github.com/apollographql/apollo-client-devtools/issues/564

axat17 avatar May 12 '21 14:05 axat17

I also have a similar issue.

kosmos avatar May 14 '21 12:05 kosmos

@hwillson I think the issue is when we use apollo client v2. See this example here: https://codesandbox.io/s/apollo-client-devtool-variables-94kn5

benatshippabo avatar May 14 '21 23:05 benatshippabo

@hwillson I think the issue is when we use apollo client v2. See this example here: https://codesandbox.io/s/apollo-client-devtool-variables-94kn5

That's also true for us, using v2.

afrankel-sfdo avatar May 17 '21 13:05 afrankel-sfdo

@hwillson can you remove needs-reproducation, we've determined the issues is related to Apollo v2. What else can we do to help move this along?

afrankel-sfdo avatar Jul 19 '21 14:07 afrankel-sfdo

Thanks @afrankel-sfdo - the absolute best way to help move this along would be if someone is able to take a quick pass at creating a PR to fix this. We'll definitely get to it soon, but a PR would help expedite things for sure. 🙏

hwillson avatar Jul 19 '21 23:07 hwillson

@hwillson traced the issue through dev tools, and far as I can tell it's a bug in the v2 client, not passing the variables correctly.

the query object here https://github.com/apollographql/apollo-client-devtools/blob/a2e0fbe9f1feec222d78b70e7f2bb494288705b2/src/application/index.tsx#L134 is missing variables

Screen Shot 2021-07-28 at 1 47 39 PM

afrankel-sfdo avatar Jul 28 '21 19:07 afrankel-sfdo

@hwillson any insights for the above?

afrankel-sfdo avatar Aug 09 '21 14:08 afrankel-sfdo

We also had this same issue, we are currently stuck on Apollo client 2x for the time being. What I ended up doing is just grabbing the last 2x version of apollo-client-devtools here and building it and installing this old version of the chrome extension. Once I have this old version the query variables show up again.

msell avatar Oct 29 '22 13:10 msell

We also had this same issue, we are currently stuck on Apollo client 2x for the time being. What I ended up doing is just grabbing the last 2x version of apollo-client-devtools here and building it and installing this old version of the chrome extension. Once I have this old version the query variables show up again.

Yes, that is what my team did as well. Eventually we did migrate to v3 and the migration was pretty painless!

benatshippabo avatar Oct 31 '22 15:10 benatshippabo