Repository navigation
Conversation
🤖 Generated with Claude Code
This was referenced Oct 3, 2026
Owner
Author
|
🤖 Superseded by #148, which supports the directives instead of rejecting them. |
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.
Part of #149
Operations with
@skipor@includegenerate non-null types, and the result throwsInvalidDataException: Missing fieldwhen the server omits a field.This makes codegen fail instead, naming the operation, directive and location, and saying Sailor does not support client directives.
Before and after
Before:
query Foo($v: Boolean!) { bar @skip(if: $v) }generatesFoowith a non-nullbar. A skipped field throws at runtime.After: codegen throws
Sailor does not support client directives, found @skip on field bar in operation Foo in <path>.The check covers fields, inline fragments and fragment spreads, in operations and in fragment definitions (named as
fragment X).It lives in
Validator::validateDocuments(), before fragments are folded.All uses are rejected, including literal ones such as `@skip(if: false)`
Telling literal arguments apart from variables needs extra code for a case nobody should write.
Example and docs changes
examples/simple/src/clientDirectives.graphqlused all three locations, so I deleted it with its generated files inexpected/.The README gets a "Client directives" section, and the changelog lists this under Changed.
FoldFragmentsstill copies spread directives onto inlined fragments. That code is now unreachable, and I left it untouched.Size: 41 added lines in `src`
Alternatives: #79 (full support), #148 (full support on the merged field model), #146 (fields only)
🤖 Generated with Claude Code