-
Notifications
You must be signed in to change notification settings - Fork 181
Query Builder + Promise 2.0 + DataLoader #74
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
528d60c
to
8bc7003
Compare
b0e4319
to
b356f66
Compare
446a2c3
to
d22798f
Compare
Other option would be making middleware verification that happens on #L47[https://github.com/graphql-python/graphql-core/blob/features/next-query-builder/graphql/execution/executor.py#L47] before calling the experimental executor on #L36[https://github.com/graphql-python/graphql-core/blob/features/next-query-builder/graphql/execution/executor.py#L36]
Accept custom middleware on experimental executor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR focuses on:
OrderedDict
, using an enhanced dict (with field ordering) that will improves speed about ~35% ifcyordereddict
is installed and ~3x if using the nativeOrderedDict
(the OrderedDict implementation in Python < 3.5 is pure python, while in newer python versions is implemented in C).Try it in your repo
Install the dependencies
If you want to use the faster experimental executor, add this code in your GraphQL implementation before executing any query:
Details
Performance
Using the Query Builder strategy the performance for resolving objects is expected to improve from 2 to 10x.
Related issue in Graphene: graphql-python/graphene#268
Promise 2.0
The new promise implementation is quite performant, has non-blocking lazy Events (for faster waits on promises) and a initial DataLoader implementation.
Related PR in promise with the details: syrusakbary/promise#23
DataLoader
With the new promise package, we can use also a DataLoader for solving the N+1 problem in GraphQL.
How to use DataLoader with Graphene