Skip to content

Commit d9f743c

Browse files
author
Jason Kuhrt
authored
docs: fix nullability jsdoc (#731)
1 parent 78b8b08 commit d9f743c

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/definitions/nonNull.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,14 @@ withNexusSymbol(NexusNonNullDef, NexusTypes.NonNull)
2222
*
2323
* Modify a type to be Non-Null.
2424
*
25-
* In Nexus input postition types are non-null by default so this has no use for them (until you've changed
26-
* the default). On the other hand output postition types are nullable by default so use this to modify them
27-
* (until you've changed the default).
25+
* In Nexus input and output position types are nullable by default so use this to modify them so long as
26+
* you've not changed the non-null defaults for one or both positions.
2827
*
2928
* If you find yourself using this a large majority of the time then consider changing your nullability defaults.
3029
*
3130
* @example
3231
* objectType({
3332
* name: 'User',
34-
* nonNullDefaults: {
35-
* inputs: false,
36-
* },
3733
* definition(t) {
3834
* t.field('id', {
3935
* type: nonNull('ID'),

src/definitions/nullable.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ withNexusSymbol(NexusNullDef, NexusTypes.Null)
2222
*
2323
* Remove the Non-Null wrapper from a type, if present.
2424
*
25-
* In Nexus input postition types are non-null by default so this is useful to modify them (until you've
26-
* changed the default). On the other hand output postition types are nullable by default so this has no use
27-
* for them (until you've changed the default).
25+
* In Nexus input and output position types are nullable by default so this has ***no use*** until you've
26+
* changed the non-null defaults for one or both positions.
2827
*
2928
* If you find yourself using this a large majority of the time then consider changing your nullability defaults.
3029
*
3130
* @example
3231
* objectType({
3332
* name: 'User',
3433
* nonNullDefaults: {
34+
* inputs: true,
3535
* outputs: true,
3636
* },
3737
* definition(t) {

0 commit comments

Comments
 (0)