src/Schema/AST/ASTHelper.php
public static function directiveDefinition(Node $definitionNode, string $name): ?DirectiveNode
    {
        return (new Collection($definitionNode->directives))
            ->first(function (DirectiveNode $directiveDefinitionNode) use ($name): bool {
                return $directiveDefinitionNode->name->value === $name;
            });
    }
public static function directiveDefinition(Node $definitionNode, string $name): ?DirectiveNode
    {
        return (new Collection($definitionNode->directives))
            ->first(function (DirectiveNode $directiveDefinitionNode) use ($name): bool {
                return $directiveDefinitionNode->name->value === $name;
            });
    }
public static function directiveDefinition ( Node $ definitionNode , string $ name ) : ? DirectiveNode { return ( new Collection ( $ definitionNode -> directives ) ) -> first ( function ( DirectiveNode $ directiveDefinitionNode ) use ( $ name ) : bool { return $ directiveDefinitionNode -> name -> value === $ name ; } ) ; }
This can be at most one directive, since directives can only be used once per location.

@param  \GraphQL\Language\AST\Node  $definitionNode
@param  string  $name
@return \GraphQL\Language\AST\DirectiveNode|null
This can be at most one directive since directives can only be used once per location .