-
Notifications
You must be signed in to change notification settings - Fork 823
Resolver Tagging #6
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
Comments
class Human(Character):
pet = Field(Pet)
async def resolve_pet(self, *args):
pet = await queryPetFromSomewhereWithOwner(self.instance.id)
return Pet(pet) |
I have more testing to do with 40b88bc. I'll have an answer for you tomorrow. Was just super busy today. |
p0123n
pushed a commit
to p0123n/graphene
that referenced
this issue
Aug 26, 2017
…column Convert int label column for SQLAlchemy column_property
ronachong
pushed a commit
to ronachong/graphene
that referenced
this issue
Nov 3, 2017
Fixed a bug that was causing graphql_schmea command to not import properly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
graphql-core
supports "tagging" a resolver (viacore.execution.middlewares.utils
) as a way to signal special handling of the resolver in anExecutionMiddleware
.The main example is that we have
GeventExecutionMiddleware
. By default, this middleware does nothing when processing resolvers. But when it is given a resolver that is tagged with (@run_in_greenlet
) it will spawn a greenlet to execute the resolver, and allow the executor to continue to resolve other fields concurrently.From the tests, here's a good example (not using Graphene):
In this example, if each function was not tagged with
@run_in_greenlet
, then the execution time would be 6 seconds, as they have to run serially. However, since they are tagged, the middleware will run them concurrently, executing the query in only 3 seconds.The text was updated successfully, but these errors were encountered: