Skip to content

Commit

Permalink
Improve description for @oneOf directive (#3937)
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia authored and benjie committed Jun 21, 2024
1 parent 003f4a9 commit c67dc4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/type/directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,12 @@ export const GraphQLSpecifiedByDirective: GraphQLDirective =
});

/**
* Used to declare an Input Object as a OneOf Input Objects.
* Used to indicate an Input Object is a OneOf Input Object.
*/
export const GraphQLOneOfDirective: GraphQLDirective = new GraphQLDirective({
name: 'oneOf',
description: 'Indicates an Input Object is a OneOf Input Object.',
description:
'Indicates exactly one field must be supplied and this field must not be `null`.',
locations: [DirectiveLocation.INPUT_OBJECT],
args: {},
});
Expand Down
4 changes: 3 additions & 1 deletion src/utilities/__tests__/printSchema-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,9 @@ describe('Type System Printer', () => {
url: String!
) on SCALAR
"""Indicates an Input Object is a OneOf Input Object."""
"""
Indicates exactly one field must be supplied and this field must not be \`null\`.
"""
directive @oneOf on INPUT_OBJECT
"""
Expand Down

0 comments on commit c67dc4d

Please sign in to comment.