Variable Default Type Mismatched for Value int64

Report a GraphQL Bug

What edition and version of Dgraph are you using?

Edition:

  • SlashGraphQL
  • Dgraph (community edition/Dgraph Cloud)

Have you tried reproducing the issue with the latest release?

na

Steps to reproduce the issue (paste the query/schema if possible)

type Post {
  id: ID
  title: String
}
query limitPosts($first: Int = 2) {
  queryPost(first: $first) {
    id
  }
}

Expected behaviour and actual result.

{
  "data": {
    "queryPost": []
  }
}
{
  "errors": [
    {
      "message": "Type mismatched for Value `<int64 Value>`, expected:`Int`",
      "path": [
        "variable",
        "first"
      ]
    }
  ]
}

This does appear to be a bug. Accepting it.

1 Like

Hi @verneleem, this bug is fixed in the master branch and also in 20.11.02.
We recently refactored a code regarding variable handling which fixed this and many other related
bugs.
PR: https://github.com/dgraph-io/dgraph/pull/7405