question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] Examples of GraphQL using async/await?

See original GitHub issue

Description

How can I use GraphQL in conjunction with async/await syntax?

Any examples? I see using Starlette


from graphql.execution.executors.asyncio import AsyncioExecutor

app = Starlette()

app.add_route("/", GraphQLApp(schema=graphene.Schema(query=Query, executor_class = AsyncioExecutor)

But if app is already

app = FastAPI()

now it is

app = Starlette() ?

Now add_route got an unexpected keyword argument ‘executor_class’ if

app = FastAPI()

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tiangolocommented, Feb 12, 2020

Thanks for the help @prostomarkeloff and @includeamin ! 👏 🍰

0reactions
mmartinskycommented, Apr 16, 2020

@includeamin this goes outside of the dependency injection system though, right? Do you know a way to integrate the Depends() calls into this solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why aren't resolvers in Query async/await? - Apollo Community
So we needed to add an await in front of it. We can't use await without making the parent function async , so...
Read more >
Using GraphQL or REST, that is the question - Seasoned & Agile
We create a GraphQL API for Shakespeare's work using GraphQL-core-next, asyncio, asyncpg and PostgreSQL.
Read more >
Async/Await in nestjs example - typescript - Stack Overflow
This function just passes the returned promise forward to the caller. Thus, there is no need to await any IO or work to...
Read more >
Execution - GraphQL
After being validated, a GraphQL query is executed by a GraphQL server which returns a result that mirrors the shape of the requested...
Read more >
FastAPI : async GraphQL (Graphene) | by Phil Girard - Medium
To use async Graphql resolvers in Graphql with Graphene simply do.. “FastAPI : async GraphQL ... [QUESTION] Examples of GraphQL using async/await?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found