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

Cannot use AsyncioExecutor #121

Closed
mecampbellsoup opened this issue Feb 28, 2021 · 2 comments
Closed

Cannot use AsyncioExecutor #121

mecampbellsoup opened this issue Feb 28, 2021 · 2 comments

Comments

@mecampbellsoup
Copy link

The Starlette docs indicate that I should import an "async executor" a la:

from graphql.execution.executors.asyncio import AsyncioExecutor

However this module graphql.execution.executors no longer seems to exist in graphql-core versions > 3.

How should one go about using graphql-core now (i.e. version 3+) with async executors? Or should I just use the core-legacy library? My async resolve_* queries are otherwise erroring as follows:

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 396, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/fastapi/applications.py", line 199, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/applications.py", line 111, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 181, in __call__
    raise exc from None
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.9/site-packages/starlette/exceptions.py", line 82, in __call__
    raise exc from None
  File "/usr/local/lib/python3.9/site-packages/starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 566, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 227, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/graphql.py", line 52, in __call__
    response = await self.handle_graphql(request)
  File "/usr/local/lib/python3.9/site-packages/starlette/graphql.py", line 105, in handle_graphql
    [format_graphql_error(err) for err in result.errors]
  File "/usr/local/lib/python3.9/site-packages/starlette/graphql.py", line 105, in <listcomp>
    [format_graphql_error(err) for err in result.errors]
TypeError: 'NoneType' object is not callable
@Cito
Copy link
Member

Cito commented Mar 1, 2021

You should ask about this in the Starlette project. It seems Starlette supports only Graphene 2 which means GraphQL-Core 2 (legacy, not supported any more). The GraphQLApp class seems to be deprecated inside Starlette also.

The current GraphQL-core does not have have executors and uses async execution by default.

@lovetoburnswhen
Copy link

FYI Starlette has deprecated built-in GraphQL support. See #619

@Cito Cito closed this as completed Dec 27, 2021
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

3 participants