Skip to content

Replace 'query error' with 'request error' #803

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 4 commits into from
Apr 7, 2021

Conversation

benjie
Copy link
Member

@benjie benjie commented Nov 28, 2020

This is a specific change from #777 applied throughout the spec.

The term "query error" feels limited to GraphQL query operations; however the error could be raised from mutations or subscriptions too, in fact it can also be raised when it's not clear what operation is to be executed (e.g. when there's a document with multiple operations, but no operationName was provided). As such, the error does not relate specifically to "query", or even "operation", but to the entire GraphQL request.

Relates to graphql/graphql-wg#546

@leebyron leebyron added the 💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md) label Jan 7, 2021
@leebyron
Copy link
Collaborator

leebyron commented Jan 7, 2021

For posterity from live discussion:

Agreement on this change - a further improvement would be to at some point describe what a "request error" is

@benjie
Copy link
Member Author

benjie commented Feb 8, 2021

I've added a definition for request errors and linked it from the first time it's mentioned (I'm not sure if it should be linked from each place?). I've also reviewed the content in section 7 and updated some of the uses of "operation" to "request" where they may apply before the operation can even be determined.

Comment on lines 23 to 25
If the request encountered any errors, the response map must contain an
entry with key `errors`. The value of this entry is described in the "Errors"
section. If the operation completed without encountering any errors, this entry
must not be present.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the request might encounter an error before the operation can be determined (for example if operationName is not given but the document contains multiple operations, or of the document contains no operations), hence 'If the request encountered any errors.' However the final sentence is still correct - it does indeed relate to the operation completing without errors - for the operation to even begin there must be no errors before this point. Since it's valid both ways (and there's no ambiguity) I left this final sentence unedited.

@leebyron leebyron added 🏁 Accepted (RFC 3) RFC Stage 3 (See CONTRIBUTING.md) and removed 💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md) labels Mar 4, 2021
@leebyron leebyron added this to the May2021 milestone Apr 6, 2021
benjie and others added 3 commits April 6, 2021 23:18
Saw "throw" / "raise" / "occur" / "encounter" - most dominant verb is "raise" so standardizing that.
@leebyron leebyron force-pushed the query-ambiguity-request-error branch from efbbc0b to b66f783 Compare April 7, 2021 06:34
@leebyron leebyron force-pushed the query-ambiguity-request-error branch from 8956149 to c63b6a5 Compare April 7, 2021 07:26
@leebyron
Copy link
Collaborator

leebyron commented Apr 7, 2021

@benjie - please let me know if my additions here look good to you.

Once I have this one merged I'll rebase #777 and merge (assuming that one also looks good)

@benjie
Copy link
Member Author

benjie commented Apr 7, 2021

This looks good to me 👍

@leebyron leebyron merged commit 9cb9a4b into graphql:main Apr 7, 2021
@benjie benjie deleted the query-ambiguity-request-error branch April 8, 2021 07:38
with names not defined by a field of this input object type, otherwise an error
must be thrown.
with names not defined by a field of this input object type, otherwise a
response error must be raised.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benjie I noticed this term "response error" which is used only once in the spec and was introduced in this PR (which was the PR that introduced the term "request error"). Was this a mistake and should also say "request error"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I suspect it should either be request error or field error. I'd have to read it carefully to figure out which - I'll add this to my list to review. Thanks for spotting!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should have been request error indeed. Thanks for spotting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏁 Accepted (RFC 3) RFC Stage 3 (See CONTRIBUTING.md)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants