Closed
Description
It has been reported to us that when custom scalar with parse_literal
is given literal value in query that has been called with variables, function passed to parse_literal
will be called with two arguments instead of one: ast
of literal and dict with query variables:
query TestQuery($variable: ID) {
field(scalar: "STRING")
otherField(id: $variable)
}
This produces tricky to debug error, eg.:
Argument 'scalar' has invalid value "STRING"
However actual error is TypeError
for function being called with two arguments instead of one.
However GraphQL.js documentation doesn't mention this behaviour:
https://graphql.org/graphql-js/type/#graphqlscalartype
I've found that value_from_ast_untyped
is called with two arguments in situation when query variables are present, but couldn't find anything about custom parse_literal
.
Is this intended?
Metadata
Metadata
Assignees
Labels
No labels