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

[GraphQL] error type missing when syntax error #159

Closed
roma-glushko opened this issue Nov 11, 2024 · 1 comment · Fixed by #160
Closed

[GraphQL] error type missing when syntax error #159

roma-glushko opened this issue Nov 11, 2024 · 1 comment · Fixed by #160
Labels
bug Something isn't working GraphQL

Comments

@roma-glushko
Copy link

When there is a syntax error like this one:

Response(200 OK, data_model=<class 'githubkit.graphql.models.GraphQLResponse'>)
data=None errors=[GraphQLError(type=None, message='Expected NAME, actual: COLON (":") at [3, 64]', locations=[SourceLocation(line=3, column=64)], path=None, extensions=None)] extensions=None
[]

The GraphQLResponse schema fails to parse it with the following error:

1 validation error for ParsingModel[GraphQLResponse]
__root__ -> errors -> 0 -> type
  field required (type=value_error.missing)
[]

Seems like the error schema has type as a required field but it doesn't hold true in case of syntax errors.

@yanyongyu yanyongyu added bug Something isn't working GraphQL labels Nov 12, 2024
@yanyongyu
Copy link
Owner

yanyongyu commented Nov 12, 2024

Confirm that the type field is missing when syntax error.

In the octokit's issue,

Yes, the type field is going to be returned with every error.

😅 Maybe this case also affects the octokit's error type.

@yanyongyu yanyongyu changed the title [GraphQL] GraphQLResponse validation error on query syntax error [GraphQL] error type missing when syntax error Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GraphQL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants