-
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
Separate validation of operation and coercion of variables into separate steps #3658
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -871,7 +871,6 @@ describe('Execute: Handles basic execution tasks', () => { | |
expectJSON( | ||
executeSync({ schema, document, operationName: 'Q' }), | ||
).toDeepEqual({ | ||
data: null, | ||
errors: [ | ||
{ | ||
message: 'Schema is not configured to execute query operation.', | ||
|
@@ -883,7 +882,6 @@ describe('Execute: Handles basic execution tasks', () => { | |
expectJSON( | ||
executeSync({ schema, document, operationName: 'M' }), | ||
).toDeepEqual({ | ||
data: null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
errors: [ | ||
{ | ||
message: 'Schema is not configured to execute mutation operation.', | ||
|
@@ -895,7 +893,6 @@ describe('Execute: Handles basic execution tasks', () => { | |
expectJSON( | ||
executeSync({ schema, document, operationName: 'S' }), | ||
).toDeepEqual({ | ||
data: null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
errors: [ | ||
{ | ||
message: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -424,6 +424,7 @@ describe('Subscription Initialization Phase', () => { | |
{ | ||
message: 'The subscription field "unknownField" is not defined.', | ||
locations: [{ line: 1, column: 16 }], | ||
path: ['unknownField'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure about this one. There is not an exact corollary to queries/mutations, because unknown fields there are silently dropped rather than raising an error. The spec at https://spec.graphql.org/draft/#sel-HAPHRPJABABmE-1Y says:
The last sentence seems odd to me as the paths in the response and the request are the same -- perhaps it should be interpreted that the path is the path in the response, not in the schema. That might argue as you have here that a field not in the schema can have a path. Although, I am not sure about this, as perforce if the field is not in the schema, it cannot be in the response. For subscriptions, of course, there is no path in the response of CreateSourceEventStream, as the response for that section of the algorithm is not a map, it's an AsyncIterable. So, overall, I think we are better off without the path, although it seems to me that it could go either way. |
||
}, | ||
], | ||
}); | ||
|
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 change fits your proposed simplified criteria here: graphql/graphql-spec#894 (comment) but I am not sure about it