I have the following schema:
type Post {
id: ID!
text: String
}
I am using autogenerated mutations from neo4j-graphql.js
, so I have access to the following mutation:
UpdatePost(
id: ID!
text: String
): Post
The issue:
When I'm using the following query:
mutation update($id: String, $text: String) {
UpdatePost(id: $id, text: $text) {
id
text
}
}
With the following parameters:
{
"id": "a19289b3-a191-46e2-9912-5a3d1b067cb2",
"text": "text"
}
I get the following error:
{
"error": {
"errors": [
{
"message": "Variable \"$id\" of type \"String\" used in position expecting type \"ID!\".",
"locations": [
{
"line": 1,
"column": 17
},
{
"line": 2,
"column": 18
}
],
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED"
}
}
]
}
}
Is there a way to convert my string ID to the actual ID type? Or circumvent this error altogether?