Skip to content

Commit 5745bf6

Browse files
authored
Specify 'subscription' as valid $operation value (webonyx#733)
`Parser::parseOperationDefinition` will create a `OperationDefinitionNode` and propagate the `operation` type it finds. In `::parseExecutableDefinition` the function is called with `query`, `mutation`, or `subscription`. This means `OperationDefinitionNode` can exist where `$operation` is `subscription`. The property type annotation doesn't currently match with this possible behaviour so we should update it :)
1 parent ab9faa2 commit 5745bf6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Language/AST/OperationDefinitionNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class OperationDefinitionNode extends Node implements ExecutableDefinitionNode,
1212
/** @var NameNode|null */
1313
public $name;
1414

15-
/** @var string (oneOf 'query', 'mutation')) */
15+
/** @var string (oneOf 'query', 'mutation', 'subscription')) */
1616
public $operation;
1717

1818
/** @var NodeList<VariableDefinitionNode> */

0 commit comments

Comments
 (0)