Skip to content

Vue Reactive Variables no longer work with @urql/vue 2 #3834

@cloudsftp

Description

@cloudsftp

Describe the bug

When executing the example for vue3, formidable.dev returns a 400 error:

XHRGET
https://trygql.formidable.dev/graphql/basic-pokedex?query=query+($skip:+Int!)+{ ++pokemons(limit:+10,+skip:+$skip)+{ ++++id ++++name ++++__typename ++} }&variables={"skip":{"__v_isRef":true,"__v_isShallow":false,"_rawValue":0,"_value":0,"dep":{"__v_skip":true,"sc":0,"version":0}}}
[HTTP/2 400  120ms]

{
  "data": null,
  "errors": [
    {
      "message": "Variable \"$skip\" got invalid value { __v_isRef: true, __v_isShallow: false, _rawValue: 0, _value: 0, dep: { __v_skip: true, sc: 0, version: 0 } }; Int cannot represent non-integer value: { __v_isRef: true, __v_isShallow: false, _rawValue: 0, _value: 0, dep: { __v_skip: true, sc: 0, version: 0 } }",
      "locations": [
        {
          "line": 1,
          "column": 8
        }
      ]
    }
  ]
}

As you can tell from the url that is called and the error, the ref value seems to not be resolved correctly, but simply passed to the query.

Reproduction

https://github.com/urql-graphql/urql/tree/main/examples/with-vue3

Urql version

  "dependencies": {
    "@urql/core": "^6.0.1",
    "@urql/vue": "^2.0.0",
    "graphql": "^16.6.0",
    "vue": "^3.2.47"
  }

Validations

  • I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
  • Read the docs.
  • Follow our Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions