Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurs when you do multiple queries and in subsequent queries use the value from the first query. #4040

Closed
ErbolLab opened this issue Oct 24, 2018 · 15 comments
Assignees

Comments

@ErbolLab
Copy link

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:

  1. Do a query with a variable
  2. Change the variable value to something
  3. 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

@GlennMatthys
Copy link

GlennMatthys commented Oct 24, 2018

Related: #4034

@ankitjain-xyz
Copy link

@GlennMatthys I followed #4034 but the error still exists. Can you please help resolve this?

@francoisromain
Copy link

Same thing here. I've seen #4034, updated apollo utilities to 1.0.23, but still have this error.

@mpecro
Copy link

mpecro commented Oct 24, 2018

Same

@AlexanderYW
Copy link

Same as well, tried forcing it to a lower version, but with no luck, anyone knows how to do this?, just as a temporary workaround for this

@JasonLi914
Copy link

JasonLi914 commented Oct 24, 2018

For me, I was able to put in a resolution for apollo-utilities version 1.0.21 to get it working for now, am not sure why it appears to be breaking for versions lower than that. And I believe #4052 might address this issue?

@ankitjain-xyz
Copy link

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

@francoisromain
Copy link

rolling back to apollo-cache-inmemory: 1.3.5 and apollo-client 2.4.2 don't fix the problem. @benjamn do you know how to fix temporary? Thank you

@NicoAiko
Copy link

@francoisromain Try npm i apollo-utilities@latest
It should overwrite the version that was installed by apollo-client.

@francoisromain
Copy link

francoisromain commented Oct 25, 2018

@NicoAiko I tried that already, but it didn't fix the bug.

@Akryum
Copy link

Akryum commented Oct 25, 2018

For vue-cli, setting a yarn resolution "apollo-utilities": "1.0.21" worked. Version 1.0.23 still has the issue.

@cotillion
Copy link

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

@ankitjain-xyz
Copy link

Thanks @cotillion. This works as a quick fix.

@mpecro
Copy link

mpecro commented Oct 25, 2018

@cotillion you save my life

@benjamn
Copy link
Member

benjamn commented Oct 26, 2018

I believe this is fixed by apollo-utilities@1.0.24 (which corresponds to apollo-client@2.4.4), as demonstrated by this updated CodeSandbox repro: https://codesandbox.io/s/71xnmqok51

@benjamn benjamn closed this as completed Oct 26, 2018
@benjamn benjamn self-assigned this Oct 26, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests