-
-
Notifications
You must be signed in to change notification settings - Fork 744
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow introspection fields on subscription root (#5187)
- Loading branch information
1 parent
66b9dce
commit 9affedb
Showing
6 changed files
with
116 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
src/HotChocolate/Core/src/Validation/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
.../__snapshots__/SubscriptionSingleRootFieldRuleTests.DisallowedOnlyIntrospectionField.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[ | ||
{ | ||
"Message": "Subscription must not select an introspection top level field.", | ||
"Code": null, | ||
"Path": null, | ||
"Locations": [ | ||
{ | ||
"Line": 2, | ||
"Column": 17 | ||
} | ||
], | ||
"Extensions": { | ||
"specifiedBy": "http://spec.graphql.org/October2021/#sec-Single-root-field" | ||
}, | ||
"Exception": null, | ||
"SyntaxNode": { | ||
"Kind": "OperationDefinition", | ||
"Location": { | ||
"Start": 17, | ||
"End": 97, | ||
"Line": 2, | ||
"Column": 17 | ||
}, | ||
"Name": { | ||
"Kind": "Name", | ||
"Location": { | ||
"Start": 30, | ||
"End": 35, | ||
"Line": 2, | ||
"Column": 30 | ||
}, | ||
"Value": "sub" | ||
}, | ||
"Operation": "Subscription", | ||
"VariableDefinitions": [], | ||
"Directives": [], | ||
"SelectionSet": { | ||
"Kind": "SelectionSet", | ||
"Location": { | ||
"Start": 34, | ||
"End": 97, | ||
"Line": 2, | ||
"Column": 34 | ||
}, | ||
"Selections": [ | ||
{ | ||
"Kind": "Field", | ||
"Alias": null, | ||
"Arguments": [], | ||
"Required": null, | ||
"SelectionSet": null, | ||
"Location": { | ||
"Start": 56, | ||
"End": 84, | ||
"Line": 3, | ||
"Column": 21 | ||
}, | ||
"Name": { | ||
"Kind": "Name", | ||
"Location": { | ||
"Start": 56, | ||
"End": 84, | ||
"Line": 3, | ||
"Column": 21 | ||
}, | ||
"Value": "__typename" | ||
}, | ||
"Directives": [] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] |