Skip to content

Commit 0777407

Browse files
committed
Improve description for @oneOf directive
Follow up from #3513. I think it is fine for the spec text in graphql/graphql-spec#825 to refer to `OneOf Input Object`, as the spec explains what that is in another section. In a directive definition, that explanation by itself does not make much sense without prior knowledge.
1 parent fae5da5 commit 0777407

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/type/directives.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,11 @@ 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: 'Indicates that exactly one field must be supplied and that field must not be `null`.',
256256
locations: [DirectiveLocation.INPUT_OBJECT],
257257
args: {},
258258
});

src/utilities/__tests__/printSchema-test.ts

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

0 commit comments

Comments
 (0)