-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Description
Hi,
I have trouble calling following custom function from GraphQL:
CREATE FUNCTION images_in_cell(wall uuid, gridX integer, gridY integer)
RETURNS SETOF images AS $$
SELECT *
FROM images
WHERE
wall_id = wall AND
FLOOR(x / 1000 + width / 2) = gridX AND
FLOOR(y / 1000 + height / 2) = gridY
$$ LANGUAGE sql STABLE;
This is the query I try to submit:
query {
images_in_cell(args:{wall: "8e3e4a14-c831-45a2-9e78-8e86028d1ee5", gridx:1, gridy:1}) {
id
}
}
Here the GraphiQL editor complains that it expected type Int! for the "wall" argument. If I run the query, I get following result:
{
"errors": [
{
"extensions": {
"path": "$.selectionSet.images_in_cell.args.args.gridy",
"code": "parse-failed"
},
"message": "A string is expected for type : uuid"
}
]
}
It seems like Hasura mixes up the argument types of wall and gridy.
I just updated Hasura to version v1.0.0-alpha41 and I am running it with PostgreSQL 11.2 using the docker-compose file provided in your quickstart documentation.
If you need any other information or want me to try something else, feel free to ask! I would also be very glad for any workaround.
Edit:
After getting some help in the discord channel: It works if I move the wall argument to the end of the argument list of my function.
Metadata
Metadata
Assignees
Labels
No labels