Skip to content

Commit af58560

Browse files
committed
better SemanticNullable docs
1 parent 24474fa commit af58560

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/type/definition.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -548,24 +548,21 @@ export class GraphQLSemanticNonNull<T extends GraphQLNullableType> {
548548
/**
549549
* Semantic-Nullable Type Wrapper
550550
*
551-
* A semantic-non-null is a wrapping type which points to another type.
552-
* Semantic-non-null types enforce that their values are never null unless
553-
* caused by an error being raised. It is useful for fields which you can make
554-
* a guarantee on non-nullability in a no-error case, for example when you know
555-
* that a related entity must exist (but acknowledge that retrieving it may
556-
* produce an error).
551+
* A semantic-nullable is a wrapping type which points to another type.
552+
* Semantic-nullable types allow their values to be null.
557553
*
558554
* Example:
559555
*
560556
* ```ts
561557
* const RowType = new GraphQLObjectType({
562558
* name: 'Row',
563559
* fields: () => ({
564-
* email: { type: new GraphQLSemanticNonNull(GraphQLString) },
560+
* email: { type: new GraphQLSemanticNullable(GraphQLString) },
565561
* })
566562
* })
567563
* ```
568-
* Note: the enforcement of non-nullability occurs within the executor.
564+
* Note: This is equivalent to the unadorned named type that is
565+
* used by GraphQL when it is not operating in SemanticNullability mode.
569566
*
570567
* @experimental
571568
*/

0 commit comments

Comments
 (0)