![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/webonyx/graphql-php/src/Validator/Rules/ |
<?php declare(strict_types=1); namespace GraphQL\Validator\Rules; use GraphQL\Error\Error; use GraphQL\Language\AST\FragmentSpreadNode; use GraphQL\Language\AST\NodeKind; use GraphQL\Validator\QueryValidationContext; class KnownFragmentNames extends ValidationRule { public function getVisitor(QueryValidationContext $context): array { return [ NodeKind::FRAGMENT_SPREAD => static function (FragmentSpreadNode $node) use ($context): void { $fragmentName = $node->name->value; $fragment = $context->getFragment($fragmentName); if ($fragment !== null) { return; } $context->reportError(new Error( static::unknownFragmentMessage($fragmentName), [$node->name] )); }, ]; } public static function unknownFragmentMessage(string $fragName): string { return "Unknown fragment \"{$fragName}\"."; } }