-
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
Introduce "recommended" validation rules #4118
Merged
Merged
Conversation
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
✅ Deploy Preview for compassionate-pike-271cb3 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @benjie, I'm @github-actions bot happy to help you with this PR 👋 Supported commandsPlease post this commands in separate comments and only one per comment:
|
michaelstaib
approved these changes
Jun 21, 2024
This was referenced Jun 21, 2024
SimonSapin
added a commit
to apollographql/router
that referenced
this pull request
Sep 9, 2024
This protection against introspection queries generating huge responses was added recently in graphql-js graphql/graphql-js#4118 and ported to rust apollographql/apollo-rs#904, but is not yet present in the graphql-js version used by router-bridge. This disables it for now from Rust introspection, in order to match the current state of JS introspection. Adding this rule (in both implementations) can be revisited separately. In particular: the depth limit is hard-coded to 3. Is that the right number? Should it be configurable? Is the rule checking the right set of fields?
SimonSapin
added a commit
to apollographql/router
that referenced
this pull request
Sep 10, 2024
This protection against introspection queries generating huge responses was added recently in graphql-js graphql/graphql-js#4118 and ported to rust apollographql/apollo-rs#904, but is not yet present in the graphql-js version used by router-bridge. This disables it for now from Rust introspection, in order to match the current state of JS introspection. Adding this rule (in both implementations) can be revisited separately. In particular: the depth limit is hard-coded to 3. Is that the right number? Should it be configurable? Is the rule checking the right set of fields?
TylerBloom
pushed a commit
to apollographql/router
that referenced
this pull request
Sep 16, 2024
This protection against introspection queries generating huge responses was added recently in graphql-js graphql/graphql-js#4118 and ported to rust apollographql/apollo-rs#904, but is not yet present in the graphql-js version used by router-bridge. This disables it for now from Rust introspection, in order to match the current state of JS introspection. Adding this rule (in both implementations) can be revisited separately. In particular: the depth limit is hard-coded to 3. Is that the right number? Should it be configurable? Is the rule checking the right set of fields?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The GraphQL specification mandates certain validation rules that all compliant GraphQL services must implement. Beyond these, services are free to add their own validation rules. The TSC has been discussing the idea of "recommended" validation rules for some time, rules that are not mandatory for compliance but are recommended to enhance the resilience of GraphQL schemas.
@enisdenjo has developed a new validation rule to limit introspection query depth; the TSC saw this as an excellent opportunity to introduce the new "recommended" validation rules system.
This PR introduces a new
recommendedRules
export to contain these recommended rules, starting with Denis' rule. To ensure seamless integration we are merging theserecommendedRules
into the existingspecifiedRules
export, which acts as the default list of validation rules (we may adjust this approach in a future major release, possibly by exposing adefaultRules
export, but for now we aim to ease adoption).Services can opt-out of the recommended rules by creating their own rules list without them:
We anticipate adding to these recommended rules over time and iterating them based on community feedback. Ultimately they may become recommended as part of the official specification, or be removed from the defaults.