We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We stumbled upon the following situation:
@include
null
In this case, I'd expect to have an exception, as graphql-js does. Instead, any non-false value is treated as true.
graphql-js
true
Simplified example:
$queryType = new ObjectType([ 'name' => 'Query', 'fields' => [ 'test' => [ 'type' => Type::string(), ] ] ]); $schema = new Schema([ 'query' => $queryType ]); $root = [ 'test' => '123' ]; $query = <<<GQL query Q(\$include: Boolean = false) { test @include(if: \$include) } GQL; $vars = [ 'include' => null, ]; $result = GraphQL::executeQuery($schema, $query, $root, null, $vars); print_r($result->data);
This code prints:
Array ( [test] => 123 )
Where equivalent JS code throws:
GraphQLError: Argument "if" of non-null type "Boolean!" must not be null.
The text was updated successfully, but these errors were encountered:
It looks like #262 resolves it
Sorry, something went wrong.
This is fixed in master via bf4e7d4
No branches or pull requests
We stumbled upon the following situation:
@include
directive.null
.In this case, I'd expect to have an exception, as
graphql-js
does. Instead, any non-false value is treated astrue
.Simplified example:
This code prints:
Where equivalent JS code throws:
The text was updated successfully, but these errors were encountered: