Repository navigation
Agent package, slice 3: query validator - #108
Merged
Merged
Conversation
Third slice of the agent package (docs/design/agent-mode.md): every query the agent writes is checked against the scoped schema before it is sent. It checks the document (one query operation, no schema definitions), allowed roots, fields that exist and aren't omitted, leaf and object selections, fragments and inline fragments through their type conditions, arguments, input objects including filters, enum values, scalar kinds and variables. Variable values are checked too, so an omitted field cannot be passed in through a variable. Introspection and directives other than @include and @Skip are blocked. All errors are returned at once with a path and a fix: available names, "did you mean" suggestions, and the paging pattern for paged fields. Every query the validator accepts in the tests is also run against the test server, so the validator cannot be more lenient than the server.
This file contains hidden or 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
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.
Third slice of the agent package described in docs/design/agent-mode.md: every query the agent writes is checked against the scoped schema before it is sent.
Changes
Validator (
QueryValidator, internal)nullinto non-null.__schema,__type) and directives other than@includeand@skip.Design doc: slice status, and the note that variable values are validated.
Testing
QueryValidatorTests):