-
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: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for graphql-spec-draft ready!
To edit notification comments on pull requests, go to your Netlify project 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: |
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. |
c776fa7
to
97d43ba
Compare
Hey @benjie it looks like rebasing this may be more pain than just replicating the intent of this change in a new PR given the other changes that we've merged over the last few months. I'll try to replicate it |
Reintroduces #894 atop latest main Co-authored-by: Benjie <[email protected]>
Did my best to re-introduce this change in #1174 as written
|
Reintroduces graphql#894 atop latest main Co-authored-by: Benjie <[email protected]>
e53860e
to
f16f52f
Compare
As mentioned in this comment; I have: Merged the changes from #1174 back into this PR 1 and have then2:
All in all I think this makes the spec text a lot clearer without having to rename any algorithms or introduce different verbs. Footnotes
|
Closing out #1174 - sorry for the cross-wise discussion. I pulled the important bits out as an inline edit to the prior comment in this PR just to keep the thread of discussion somewhat possible to follow. |
@benjie I like this new draft! Its a much tighter editorial change if it isn't renaming algos. I think this new "operation execution" term and definition seems right to me. "ExecuteRequest" remains slightly weird in the context of having both "execution error" and "request error" but I think your clarification note mitigates that pretty reasonably. I'll go through this again, but I think this has a clear path to merge |
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 feels, even with the subscription piece discussed in the WG, to be a net improvement over the status quo, so I'd be happy with this then tinkering around the subscription phase question later.
For a visualization; this is essentially what we want: flowchart TD
ValidateDocument --> GetOperation
subgraph ExecuteRequest
GetOperation --> CoerceVariableValues
end
subgraph SubscriptionSetup
CoerceVariableValues -->|is subscription?| CreateSourceEventStream
end
subgraph OperationExecution
CoerceVariableValues -->|is query?| ExecuteQuery
CoerceVariableValues -->|is mutation?| ExecuteMutation
subgraph Subscribe
CreateSourceEventStream --> MapSourceToResponseEvent
end
end
It's very clear to me that That said, I also agree with Lee that it's kind of weird it being in But I also feel that the last step in I do not have a better proposal, but I strongly feel that the I personally think the state in this PR is okay: flowchart TD
ValidateDocument --> GetOperation
subgraph ExecuteRequest
GetOperation --> CoerceVariableValues
CoerceVariableValues -->|is subscription?| CreateSourceEventStream
end
subgraph OperationExecution
CoerceVariableValues -->|is query?| ExecuteQuery
CoerceVariableValues -->|is mutation?| ExecuteMutation
subgraph Subscribe
CreateSourceEventStream --> MapSourceToResponseEvent
end
end
and it's significantly clearer than what we had before (which I can't draw a mermaid diagram of, so here's an awfully hacked together screenshot): |
UPDATE: 2025-07-03
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.It seems that the boundary that we refer to as "execution" is actually the Executing Operations section of the spec. So I have replaced the term "execution" in the relevant places with "operation execution", defined this new term, and slightly tweaked the algorithms so that they adhere to this division. I've also added a couple of clarifying notes.