mathsgod / graphqlite-laminas-paginator-type
1.0.0
2022-04-19 08:47 UTC
Requires (Dev)
- laminas/laminas-paginator: ^2.12
- thecodingmachine/graphqlite: ^5.0
README
Setup
use Laminas\Paginator\Mappers\TypeMapperFactory; use TheCodingMachine\GraphQLite\SchemaFactory; $factory = new SchemaFactory($cache, $container); $factory->addTypeMapperFactory(new TypeMapperFactory); // add type mapper
Example
//Controller class class Root{ #[Query()] /** * @return Product[] */ function products():Paginator{ //get the products paginator return $paginator; } } //Type class #[Type] class Product{ #[Field] public string $name }
query{ products{ items(limit:5,offset:10){ name } count } }