Skip to content

Commit 569bc93

Browse files
committed
Fix incorrect API doc examples and copy-pasted descriptions
Replicates graphql/graphql-js@e35a025
1 parent 8a775f3 commit 569bc93

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎src/graphql/type/definition.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2733,7 +2733,9 @@ def value_to_literal(self, value: Any) -> ConstValueNode | None:
27332733
>>> rgb_type = GraphQLEnumType('RGB', {'RED': 0, 'GREEN': 1, 'BLUE': 2})
27342734
>>> print_ast(rgb_type.value_to_literal('BLUE'))
27352735
'BLUE'
2736-
>>> rgb_type.value_to_literal(3) is None
2736+
>>> rgb_type.value_to_literal(2) is None
2737+
True
2738+
>>> rgb_type.value_to_literal('PURPLE') is None
27372739
True
27382740
"""
27392741
if isinstance(value, str) and self.values.get(value):

‎src/graphql/utilities/type_info.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def enter(self, node: Node) -> None:
548548
method(node)
549549

550550
def leave(self, node: Node) -> None:
551-
"""Update this TypeInfo instance for a left AST node.
551+
"""Update this TypeInfo instance when leaving an AST node.
552552
553553
:param node: AST node being left.
554554

‎src/graphql/validation/rules/defer_stream_directive_on_valid_operations_rule.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ def can_be_skipped_via_include_directive(node: DirectiveNode) -> bool:
8888
class DeferStreamDirectiveOnValidOperationsRule(ASTValidationRule):
8989
"""Defer and stream directives are used on valid operations
9090
91-
A GraphQL document is only valid if defer and stream directives are not used
92-
in subscription operations, unless they can be disabled via their ``if``
93-
argument or the selection can be skipped via ``@skip`` or ``@include``.
91+
Subscription operations must not use unconditional ``@defer`` or ``@stream``.
92+
Their ``if`` argument must be ``false`` or a variable, unless the selection or
93+
an enclosing selection can be skipped via ``@skip`` or ``@include``.
9494
9595
:param context: The validation context used while checking the document.
9696

0 commit comments

Comments
 (0)