-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: export execution algorithm implementation as Executor class #3193
Conversation
7611c3a
to
f66639a
Compare
5c1eca6
to
459c9b8
Compare
6ca3878
to
58ba402
Compare
#3185 has now been split into the following PR stack: #3192, #3195, #3196, and this PR: #3193 Summary: #3192 introduces the GraphQLAggregateError that forms an independent feature for reporting multiple errors from a resolver, but also allows the #3195 moves the subscription code into the execution module -- at long last! -- bringing the reference implementation in line with the spec. Subscriptions within the spec are put on equal footing as queries and mutations, all three being operations that are targets for "execution," with the different execution algorithms further elaborated on within the "Execution" section of the spec. Code reuse is employed to good effect; for example, error handling for subscriptions is streamlined using the #3196 streamlines the #3193 moves all of the "execution algorithm" functions to the Executor class. The Thoughts? |
Of important note -- the |
A final (?) thought -- the Suggestions, thoughts, ideas, conversation....all welcome. |
173a790
to
176ea26
Compare
Wow this is so nice @yaacovCR 🙏🏻 Just dropping my 2 cents here; feel this is a really strong move for graphql. It'll allow consumers of this library to iterate much further in isolation with new and exciting features, that eventuate in upstream work. It'll enable defer/stream to become first-class in those areas, where the consumers understand the risk and accept it — without graphql committing to an api. Completely opening up the internal Executor allows consumers to extend this and overload with their own functionality, which could lead to some exciting experiments and help accelerate adoption in communities who require a niche. @IvanGoncharov please turn this into a reality for me <3 |
All operations, including subscription operations, are covered by the execution section of the GraphQL spec
...and executeQueryOrMutationRootFields to prepare for integration of executeSubscription
this function currently does not throw GraphQLErrors -- it is not within the parallel try block within execute
to executeSubscriptionRootField
...to execution file
to operate only on ExecutionContext
-- In at least a few cases, destructuring assignment from exeContext can improve code readability. -- Overrides to exeContext can be set using object spread syntax.
Instead of possibly retuning an array of GraphQLErrors, buildExecutionContext can throw a GraphQLAggregateError to report any encountered errors.
only called by buildExecutionContext
a3c2256
to
92912b4
Compare
This class is exported only to assist people in implementing their own executors without duplicating too much code and should be used only as last resort for cases such as experimental syntax or if certain features could not be contributed upstream. It is still part of the internal API and is versioned, so any changes to it are never considered breaking changes. If you still need to support multiple versions of the library, please use the `versionInfo` variable for version detection.
...into Executor
ExecutorArgs and ExecutionContext
176ea26
to
c124435
Compare
9cab1b5
to
ec09843
Compare
Closed this in favor of PR stack 3293 => 3302. |
This is now available for experimentation at: |
Depends on #3196.