I use Hasura and a PostGres DB. Here is the GraphQL mutation
mutation submitBeacon($thing_uid: Int, $x: Int, $y: Int, $z: Int){
insert_conf_thing(objects:
[{thing_uid: $thing_uid, my_coordinates: {type: "Point", coordinates: [$x, $y, $z]}}]) {
returning {
thing_uid
my_coordinates
} } }
Query variables
{
"thing_uid": 1744,
"x": 2,
"y": 3,
"z": 4
}
And here is the query response
{
"errors": [
{
"extensions": {
"path": "$.selectionSet.insert_conf_thing.args.objects[0].my_coordinates",
"code": "validation-failed"
},
"message": "variables are not allowed in scalars"
}
]
}
Postgres DB types : thing_uid is a BigInt my_coordinates is a Geometric type
If I replace the variables $x, $y and $z by 1, 2 and 3 in the query, everything works fine.
Why the query returns an error when I'm using parameters ?