Skip to content

Commit a070e41

Browse files
committed
Improve description for @OneOf directive
Replicates graphql/graphql-js@acf05e3
1 parent 1285cd4 commit a070e41

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/graphql/type/directives.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,13 @@ def assert_directive(directive: Any) -> GraphQLDirective:
261261
description="Exposes a URL that specifies the behavior of this scalar.",
262262
)
263263

264-
# Used to declare an Input Object as a OneOf Input Objects.
264+
# Used to indicate an Input Object is a OneOf Input Object.
265265
GraphQLOneOfDirective = GraphQLDirective(
266266
name="oneOf",
267267
locations=[DirectiveLocation.INPUT_OBJECT],
268268
args={},
269-
description="Indicates an Input Object is a OneOf Input Object.",
269+
description="Indicates exactly one field must be supplied"
270+
" and this field must not be `null`.",
270271
)
271272

272273
specified_directives: tuple[GraphQLDirective, ...] = (

tests/utilities/test_print_schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,9 @@ def prints_introspection_schema():
771771
url: String!
772772
) on SCALAR
773773
774-
"""Indicates an Input Object is a OneOf Input Object."""
774+
"""
775+
Indicates exactly one field must be supplied and this field must not be `null`.
776+
"""
775777
directive @oneOf on INPUT_OBJECT
776778
777779
"""

0 commit comments

Comments
 (0)