Skip to content

Commit acf05e3

Browse files
authored
Improve description for @oneOf directive (#3937)
1 parent b12dcff commit acf05e3

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
@@ -248,11 +248,12 @@ export const GraphQLSpecifiedByDirective: GraphQLDirective =
248248
});
249249

250250
/**
251-
* Used to declare an Input Object as a OneOf Input Objects.
251+
* Used to indicate an Input Object is a OneOf Input Object.
252252
*/
253253
export const GraphQLOneOfDirective: GraphQLDirective = new GraphQLDirective({
254254
name: 'oneOf',
255-
description: 'Indicates an Input Object is a OneOf Input Object.',
255+
description:
256+
'Indicates exactly one field must be supplied and this field must not be `null`.',
256257
locations: [DirectiveLocation.INPUT_OBJECT],
257258
args: {},
258259
});

src/utilities/__tests__/printSchema-test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,9 @@ describe('Type System Printer', () => {
795795
url: String!
796796
) on SCALAR
797797
798-
"""Indicates an Input Object is a OneOf Input Object."""
798+
"""
799+
Indicates exactly one field must be supplied and this field must not be \`null\`.
800+
"""
799801
directive @oneOf on INPUT_OBJECT
800802
801803
"""

0 commit comments

Comments
 (0)