https://github.com/mathsgod/graphqlite-laminas-paginator-type
Lamins paginator for GraphQLite
https://github.com/mathsgod/graphqlite-laminas-paginator-type
graphql laminas laminas-paginator
Last synced: 5 months ago
JSON representation
Lamins paginator for GraphQLite
- Host: GitHub
- URL: https://github.com/mathsgod/graphqlite-laminas-paginator-type
- Owner: mathsgod
- License: mit
- Created: 2022-04-11T10:40:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-19T08:53:19.000Z (over 3 years ago)
- Last Synced: 2025-03-13T09:03:24.929Z (7 months ago)
- Topics: graphql, laminas, laminas-paginator
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# graphqlite-laminas-paginator-type
## Setup
```php
use Laminas\Paginator\Mappers\TypeMapperFactory;
use TheCodingMachine\GraphQLite\SchemaFactory;$factory = new SchemaFactory($cache, $container);
$factory->addTypeMapperFactory(new TypeMapperFactory); // add type mapper```
## Example
```php
//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
}
``````gql
query{
products{
items(limit:5,offset:10){
name
}
count
}
}
```