apollo-client: An error occurs when you do multiple queries and in subsequent queries use the value from the first query.
Intended outcome:
Hi there, I’m using apollo-client alongside with vue-apollo.
An error occurs when you do multiple queries and in subsequent queries (in variables) use the value from the first query.
Step to reproduce:
- Do a query with a variable
- Change the variable value to something
- Return the variable value to the initial value
You will see an error like:
"TypeError: Invalid property descriptor. Cannot both specify accessors and a value or writable attribute, #<Object>"
This error only appers in “apollo-utilities": "1.0.16”,
https://codesandbox.io/s/436n4pnow7
Actual outcome:
There shouldn’t be any errors
How to reproduce the issue:
Please open following link: https://codesandbox.io/s/436n4pnow7
enter “3” into text box, then type “2” (the first value) and you will see an error in the console
Versions
System: OS: macOS High Sierra 10.13.4 Binaries: Node: 8.11.3 - /usr/local/bin/node Yarn: 1.7.0 - /usr/local/bin/yarn npm: 5.6.0 - /usr/local/bin/npm Browsers: Chrome: 70.0.3538.67 Safari: 11.1 npmPackages: apollo-cache-inmemory: 1.3.6 => 1.3.6 apollo-client: 2.4.3 - latest => 2.4.3 apollo-link: 1.2.3 => 1.2.3 apollo-link-http: 1.5.5 => 1.5.5 apollo-utilities: 1.0.16 => 1.0.16 vue-apollo: 3.0.0-beta.25 => 3.0.0-beta.25
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 8
- Comments: 15 (1 by maintainers)
Commits related to this issue
- fix: restaure la version précédente de graphql-client cf: https://github.com/apollographql/apollo-client/issues/4040 — committed to MTES-MCT/camino-ui by francoisromain 6 years ago
With NPM I got a downgrade to work after installing: apollo-client@2.4.2 apollo-cache@1.1.17 apollo-cache-inmemory@1.3.5 apollo-utilities@1.0.21
Unfortunately, downgrading the package version doesn’t help me. Still the same error. I’ve tried all the versions from 1.0.17 to 1.0.23
For vue-cli, setting a yarn resolution
"apollo-utilities": "1.0.21"
worked. Version1.0.23
still has the issue.@GlennMatthys I followed #4034 but the error still exists. Can you please help resolve this?
I believe this is fixed by
apollo-utilities@1.0.24
(which corresponds toapollo-client@2.4.4
), as demonstrated by this updated CodeSandbox repro: https://codesandbox.io/s/71xnmqok51Related: #4034