Skip to content
New issue

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

Parser raises an error for null Boolean Type #285

Open
DeanArbel opened this issue Feb 28, 2021 · 0 comments
Open

Parser raises an error for null Boolean Type #285

DeanArbel opened this issue Feb 28, 2021 · 0 comments

Comments

@DeanArbel
Copy link

The parser is not able to handle boolean types with null default type.

This is handled in this line: https://github.com/graphql-python/graphql-core-legacy/blob/master/graphql/language/parser.py#L502

Following a commit GitHub introduced to their schema yesterday gql can no longer parse its schema, as it fails on this null Boolean type:

{'name': 'isVerified', 'description': 'Filter by if the domain is verified.', 'type': {'kind': 'SCALAR', 'name': 'Boolean', 'ofType': None}, 'defaultValue': 'null'}

GitHub claims this change is in accordance with the GraphQL standards documentation:

By default, every type is nullable - it's legitimate to return null as any of the scalar types. Use an exclamation point to indicate a type cannot be nullable, so String! is a non-nullable string.

Therefore, it appears that a null default value for a boolean is valid in GraphQL.

Currently the code specifically ignores null values.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant