src/Schema/Factories/NodeFactory.php
protected function resolveFieldsFunction($definition): Closure
    {
        return function () use ($definition): array {
            return (new Collection($definition->fields))
                ->mapWithKeys(function (FieldDefinitionNode $fieldDefinition) use ($definition): array {
                    $fieldValue = new FieldValue(
                        new NodeValue($definition),
                        $fieldDefinition
                    );

                    return [
                        $fieldDefinition->name->value => app(FieldFactory::class)->handle($fieldValue),
                    ];
                })
                ->toArray();
        };
    }
protected function resolveFieldsFunction($definition): Closure
    {
        return function () use ($definition): array {
            return (new Collection($definition->fields))
                ->mapWithKeys(function (FieldDefinitionNode $fieldDefinition) use ($definition): array {
                    $fieldValue = new FieldValue(
                        new NodeValue($definition),
                        $fieldDefinition
                    );

                    return [
                        $fieldDefinition->name->value => app(FieldFactory::class)->handle($fieldValue),
                    ];
                })
                ->toArray();
        };
    }
protected function resolveFieldsFunction ( $ definition ) : Closure { return function ( ) use ( $ definition ) : array { return ( new Collection ( $ definition -> fields ) ) -> mapWithKeys ( function ( FieldDefinitionNode $ fieldDefinition ) use ( $ definition ) : array { $ fieldValue = new FieldValue ( new NodeValue ( $ definition ) , $ fieldDefinition ) ; return [ $ fieldDefinition -> name -> value => app ( FieldFactory :: class ) -> handle ( $ fieldValue ) , ] ; } ) -> toArray ( ) ; } ; }
Returns a closure that lazy loads the fields for a constructed type.

@param  \GraphQL\Language\AST\ObjectTypeDefinitionNode|\GraphQL\Language\AST\InterfaceTypeDefinitionNode  $definition
@return \Closure
Returns a closure that lazy loads the fields for a constructed type .