Skip to content

Commit d0635a0

Browse files
committed
Work around of parsing of "description" field of type extension nodes
1 parent 6bb552f commit d0635a0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Config/Parser/GraphQL/ASTConverter/DescriptionNode.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66

77
use GraphQL\Language\AST\Node;
88
use GraphQL\Language\AST\StringValueNode;
9+
use GraphQL\Language\AST\TypeExtensionNode;
910
use function trim;
1011

1112
class DescriptionNode implements NodeInterface
1213
{
1314
public static function toConfig(Node $node): array
1415
{
16+
if ($node instanceof TypeExtensionNode) {
17+
return [];
18+
}
19+
1520
return ['description' => self::cleanAstDescription($node->description)];
1621
}
1722

@@ -21,8 +26,6 @@ private static function cleanAstDescription(?StringValueNode $description): ?str
2126
return null;
2227
}
2328

24-
$description = trim($description->value);
25-
26-
return empty($description) ? null : $description;
29+
return trim($description->value) ?: null;
2730
}
2831
}

0 commit comments

Comments
 (0)