Skip to content

Commit c67dc4d

Browse files
spawniabenjie
authored andcommitted
Improve description for @oneOf directive (#3937)
1 parent 003f4a9 commit c67dc4d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/type/directives.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,12 @@ export const GraphQLSpecifiedByDirective: GraphQLDirective =
210210
});
211211

212212
/**
213-
* Used to declare an Input Object as a OneOf Input Objects.
213+
* Used to indicate an Input Object is a OneOf Input Object.
214214
*/
215215
export const GraphQLOneOfDirective: GraphQLDirective = new GraphQLDirective({
216216
name: 'oneOf',
217-
description: 'Indicates an Input Object is a OneOf Input Object.',
217+
description:
218+
'Indicates exactly one field must be supplied and this field must not be `null`.',
218219
locations: [DirectiveLocation.INPUT_OBJECT],
219220
args: {},
220221
});

src/utilities/__tests__/printSchema-test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,9 @@ describe('Type System Printer', () => {
672672
url: String!
673673
) on SCALAR
674674
675-
"""Indicates an Input Object is a OneOf Input Object."""
675+
"""
676+
Indicates exactly one field must be supplied and this field must not be \`null\`.
677+
"""
676678
directive @oneOf on INPUT_OBJECT
677679
678680
"""

0 commit comments

Comments
 (0)