You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add docs for SemanticNonNull support
* Update vuepress/docs/docs/schema.md
Co-authored-by: Pierre Ricadat <[email protected]>
---------
Co-authored-by: Pierre Ricadat <[email protected]>
Caliban supports deriving schemas to the form that supports [the SemanticNonNull type RFC](https://github.com/graphql/graphql-spec/pull/1065), by introducing the `@semanticNonNull` directive.
527
+
While Caliban resolves all fallible effectful types (`ZIO[R, Throwable, A]`, ...) as nullable by default,
528
+
with the feature enabled, fields that don't get resolved to nullable types (for example, `ZIO[R, Throwable, A]` where `A` is not `Option[A]`, ...)
529
+
will be marked with `@semanticNonNull` to express that the field never returns `null` unless the effect fails.
530
+
`@GQLNullable` annotation can be used to override this behavior per field.
531
+
532
+
If you have custom types that override the `Schema` trait, make sure to override `nullable` and `canFail` methods to return the correct values.
533
+
All types that return `false` for `nullable` and `true` for `canFail` will be treated as semantically non-nullable.
534
+
455
535
## Building Schemas by hand
456
536
457
537
Sometimes for whatever reason schema generation fails. This can happen if your schema has co-recursive types and derivation is unable
0 commit comments