for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is a part of GraphQL project.
*
* @author Alexandr Viniychuk <[email protected]>
* created: 2/23/17 4:19 PM
*/
namespace Youshido\GraphQL\Relay\Type;
use Youshido\GraphQL\Config\Object\ObjectTypeConfig;
use Youshido\GraphQL\Type\NonNullType;
use Youshido\GraphQL\Type\Object\AbstractObjectType;
use Youshido\GraphQL\Type\Scalar\BooleanType;
use Youshido\GraphQL\Type\Scalar\StringType;
class PageInfoType extends AbstractObjectType
{
public function build($config)
$config->addFields([
'hasNextPage' => [
'type' => new NonNullType(new BooleanType()),
'description' => 'When paginating forwards, are there more items?'
],
'hasPreviousPage' => [
'description' => 'When paginating backwards, are there more items?'
'startCursor' => [
'type' => new StringType(),
'description' => 'When paginating backwards, the cursor to continue.'
'endCursor' => [
'description' => 'When paginating forwards, the cursor to continue.'
]);
}
public function getDescription()
return "Information about pagination in a connection.";