-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Define 'execution' as in 'before execution begins' #894
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
base: benjie/incremental-common
Are you sure you want to change the base?
Define 'execution' as in 'before execution begins' #894
Conversation
✅ Deploy Preview for graphql-spec-draft ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
6dedfe9
to
d7eaf72
Compare
I guess the question is why (or why not) some errors should be considered Request errors, for example, submitting a mutation operation when no mutation root type exists. it is the fault of the graphql user, so should be considered a request error by the rough explanation given, but it does not occur during the executing requests section. |
But if you don’t validate, you can get user errors during field execution so ??? |
For that specific case that should be something raised during validation; the |
@IvanGoncharov that definition while clean is a bit circular, whether or not a path should be empty depends on whether we have started execution… |
My second attempt, to produce "non-confusing criteria" 😄 |
I think that's a fair assessment: |
18b38cd
to
0e175cb
Compare
spec/Section 7 -- Response.md
Outdated
Note: Request errors (including those raised during {ExecuteRequest()}) occur | ||
before execution begins; when a request error is raised the `data` entry should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very hard for my brain to process. I may already be in ExecuteRequest()
but still before execution begins?This feels weird.
Do we have a formal definition of what "execution" is and when it starts that we could link to maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what the purpose of this PR is 💯
Execution begins the moment that the data
property should be added to the response, which is when the root selection set is executed (after validating variables, establishing a stream in the case of subscriptions, etc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've taken a different tact by defining execution, see what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We define _execution_ as the process of executing the operation's root
selection set through {ExecuteSelectionSet()}, thus _execution_ begins when
{ExecuteSelectionSet()} is called for the first time in a request. The
{ExecuteRequest()} algorithm is a preamble for _execution_.
This is clarifying but also also adding more language to processs. I think a rename of ExecuteRequest()
would be even more clarifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not both? We use the term "execution" thoughout the spec, it makes sense to have a definition for it IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
Co-authored-by: Benoit 'BoD' Lubek <BoD@JRAF.org>
Co-authored-by: Benoit 'BoD' Lubek <BoD@JRAF.org>
I have merged in
and then applied further editorial on top based on the discussions at last months WG, restoring "execution" where appropriate, eliding "Execute" (or "Process" or "Perform") from algorithm names, and making it clear that you:
I've further clarified that you validate the document not the request, and you can execute another request without validation if the document is exactly the same - the request doesn't have to be exactly the same! (Longstanding issue.) This PR is now presented as being a PR to #1039 to keep the diff small. |
UPDATE: 2025-05-01
There are various parts of the spec that relate to a concept of "execution":
data
should be producedAll of these things actually happen during
ExecuteRequest()
, which makes it confusing to the reader thatExecuteRequest()
is not itself considered execution despite the name.I've thus defined execution, elided
Execute
from a number of algorithms, and described thatRequest()
(formerlyExecuteRequest()
) contains the preamble for "execution", followed by "execution" itself.This PR is dependent on:
ExecuteSelectionSet
withExecuteCollectedFields
#1039This PR merges in the changes from: