graphql-boilerplates/node-graphql-server

[advanced example] feed.author subquery fails when using variables

timsuchanek opened this issue · 2 comments

Query

query ($where: UserWhereInput) {
  feed {
    id
    title
    author(where: $where) {
      id
    }
  }
}

Variables

{
  "where": {
    "email": "a@a.de"
  }
}

Response

{
  "data": null,
  "errors": [
    {
      "message": "Variable \"$where\" got invalid value {\"isPublished\":true}; Field \"isPublished\" is not defined by type UserWhereInput.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "feed"
      ]
    }
  ]
}

It seems that the variable $where gets the wrong value applied.

looks like something goes south because of the where defined here: https://github.com/graphql-boilerplates/node-graphql-server/blob/master/advanced/src/resolvers/Query.js#L5

@timsuchanek can you try to rename $where in your query to $myWhere, to see if this fixes the problem?

Closing in favor of prisma-labs/prisma-binding#73.