src/Pagination/PaginationManipulator.php
public static function transformToPaginatedField(
        PaginationType $paginationType,
        FieldDefinitionNode $fieldDefinition,
        ObjectTypeDefinitionNode $parentType,
        DocumentAST $current,
        ?int $defaultCount = null,
        ?int $maxCount = null
    ): DocumentAST {
        if ($paginationType->isConnection()) {
            return self::registerConnection($fieldDefinition, $parentType, $current, $defaultCount, $maxCount);
        }

        return self::registerPaginator($fieldDefinition, $parentType, $current, $defaultCount, $maxCount);
    }
public static function transformToPaginatedField(
        PaginationType $paginationType,
        FieldDefinitionNode $fieldDefinition,
        ObjectTypeDefinitionNode $parentType,
        DocumentAST $current,
        ?int $defaultCount = null,
        ?int $maxCount = null
    ): DocumentAST {
        if ($paginationType->isConnection()) {
            return self::registerConnection($fieldDefinition, $parentType, $current, $defaultCount, $maxCount);
        }

        return self::registerPaginator($fieldDefinition, $parentType, $current, $defaultCount, $maxCount);
    }
public static function transformToPaginatedField ( PaginationType $ paginationType , FieldDefinitionNode $ fieldDefinition , ObjectTypeDefinitionNode $ parentType , DocumentAST $ current , ? int $ defaultCount = null , ? int $ maxCount = null ) : DocumentAST { if ( $ paginationType -> isConnection ( ) ) { return self :: registerConnection ( $ fieldDefinition , $ parentType , $ current , $ defaultCount , $ maxCount ) ; } return self :: registerPaginator ( $ fieldDefinition , $ parentType , $ current , $ defaultCount , $ maxCount ) ; }
Transform the definition for a field to a field with pagination.

This makes either an offset-based Paginator or a cursor-based Connection.
The types in between are automatically generated and applied to the schema.

@param  \Nuwave\Lighthouse\Pagination\PaginationType  $paginationType
@param  \GraphQL\Language\AST\FieldDefinitionNode  $fieldDefinition
@param  \GraphQL\Language\AST\ObjectTypeDefinitionNode  $parentType
@param  \Nuwave\Lighthouse\Schema\AST\DocumentAST  $current
@param  int|null  $defaultCount
@param  int|null  $maxCount
@return \Nuwave\Lighthouse\Schema\AST\DocumentAST
Transform the definition for a field to a field with pagination .