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 committed Sep 1, 2023
1 parent b12dcff commit acf05e3
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 @@ -248,11 +248,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 @@ -795,7 +795,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 acf05e3

Please sign in to comment.