-
-
Notifications
You must be signed in to change notification settings - Fork 749
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
@semanticNonNull support #7681
@semanticNonNull support #7681
Conversation
79ec25d
to
1f766a2
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7681 +/- ##
==========================================
+ Coverage 74.00% 74.03% +0.02%
==========================================
Files 2918 2920 +2
Lines 151252 151490 +238
Branches 17576 17618 +42
==========================================
+ Hits 111936 112152 +216
- Misses 33464 33485 +21
- Partials 5852 5853 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
6a2d95e
to
7344282
Compare
7344282
to
83e7547
Compare
c86300f
to
aca4e59
Compare
public string[] PureScalarListItemThrowingError(IResolverContext context) | ||
{ | ||
// TODO: How can you create a terminating error for a single item? | ||
context.ReportError(ErrorBuilder.New().SetMessage("Another error").SetPath(context.Path.Append(1)).Build()); | ||
return ["a", null!, "c"]; | ||
} |
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.
Does someone have an idea?
aca4e59
to
20a18cb
Compare
Adds a new
EnableSemanticNonNull
option that, when set totrue
, rewrites all non-null fields to nullable fields and annotates them with the@semanticNonNull
directive. A ResultFormatter is added to the rewritten fields that throws an error if anull
value is returned at a position that is marked as semantically non-null.The
@semanticNonNull
directive has alevels
argument that allows to specify the semantic non-nullability in the context of lists.0
is the outer most list and n the named type.field: String!
field: String @semanticNonNull
field: [String!]
field: [String] @semanticNonNull(levels: [ 1 ])
field: [[String!]]!
field: [[String]] @semanticNonNull(levels: [ 0, 2 ])