src/Schema/Factories/DirectiveFactory.php
protected function createAssociatedDirectivesOfType(Node $node, string $directiveClass): Collection
    {
        return (new Collection($node->directives))
            ->map(function (DirectiveNode $directive) use ($node) {
                return $this->create($directive->name->value, $node);
            })
            ->filter(function (Directive $directive) use ($directiveClass) {
                return $directive instanceof $directiveClass;
            });
    }
protected function createAssociatedDirectivesOfType(Node $node, string $directiveClass): Collection
    {
        return (new Collection($node->directives))
            ->map(function (DirectiveNode $directive) use ($node) {
                return $this->create($directive->name->value, $node);
            })
            ->filter(function (Directive $directive) use ($directiveClass) {
                return $directive instanceof $directiveClass;
            });
    }
protected function createAssociatedDirectivesOfType ( Node $ node , string $ directiveClass ) : Collection { return ( new Collection ( $ node -> directives ) ) -> map ( function ( DirectiveNode $ directive ) use ( $ node ) { return $ this -> create ( $ directive -> name -> value , $ node ) ; } ) -> filter ( function ( Directive $ directive ) use ( $ directiveClass ) { return $ directive instanceof $ directiveClass ; } ) ; }
Get all directives of a certain type that are associated with an AST node.

@param  \GraphQL\Language\AST\Node  $node
@param  string  $directiveClass
@return \Illuminate\Support\Collection <$directiveClass>
Get all directives of a certain type that are associated with an AST node .