Skip to content

crash when connecting gql to hasura #92

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

Closed
mariusnita opened this issue May 25, 2020 · 3 comments
Closed

crash when connecting gql to hasura #92

mariusnita opened this issue May 25, 2020 · 3 comments
Labels
type: bug An issue or pull request relating to a bug

Comments

@mariusnita
Copy link

Hi, I'm trying this client with hasura and it crashes when executing the introspection query due to
https://github.com/graphql-python/gql/blob/master/gql/transport/aiohttp.py#L109

If that line is just operation_name instead of operation_name or "" then it works. Hasura breaks when the operationName is set to "".

Not positive if this is a hasura issue or a gql issue.

@mariusnita mariusnita changed the title hasura bug crash when connecting gql to hasura May 25, 2020
@leszekhanusz
Copy link
Collaborator

Hi,

Could you please post here the complete error message ?

The PR #94 should fix your issue

@mariusnita
Copy link
Author

Thanks!

The relevant part of the stack trace was this:

  File ".../lib/python3.8/site-packages/gql/client.py", line 88, in execute_async
    return await session.execute(document, *args, **kwargs)
  File ".../lib/python3.8/site-packages/gql/client.py", line 279, in execute
    await self.fetch_and_validate(document)
  File ".../lib/python3.8/site-packages/gql/client.py", line 247, in fetch_and_validate
    await self.fetch_schema()
  File ".../lib/python3.8/site-packages/gql/client.py", line 298, in fetch_schema
    self.client.schema = build_client_schema(self.client.introspection)
  File ".../lib/python3.8/site-packages/graphql/utilities/build_client_schema.py", line 56, in build_client_schema
    raise TypeError(
TypeError: Invalid or incomplete introspection result. Ensure that you are passing the 'data' attribute of an introspection response and no 'errors' were returned alongside: None.

And this was the hasura reply

{'errors': [{'extensions': {'path': '$', 'code': 'validation-failed'}, 'message': 'no such operation found in the document: ""'}]}

leszekhanusz added a commit that referenced this issue Jun 14, 2020
Fix connecting to servers which do not support setting operationName to "" (#92)
@KingDarBoja KingDarBoja added the type: bug An issue or pull request relating to a bug label Jun 15, 2020
@leszekhanusz
Copy link
Collaborator

Fixed in version v3.0.0a1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug
Projects
None yet
Development

No branches or pull requests

3 participants