class Connection implements OperationResolver (View source)

A connection to a list of items on a object type. Collections are paginated and return a list of edges.

friends(limit:2,offset:2,sortBy:[{field:Name,direction:ASC}]) { edges { node { name } } pageInfo { totalCount hasPreviousPage hasNextPage } }

Traits

Methods

__construct(string $connectionName)

No description

$this
setConnectionResolver($func)

No description

$this
setConnectionType(ObjectType|callable $type)

Pass in the {@link ObjectType}.

ObjectType|callable
getConnectionType(bool $evaluate = true)

Evaluate Connection type

callable
getConnectionResolver()

No description

$this
setArgs($args)

No description

$this
setDescription($string)

No description

string
getDescription()

No description

$this
setSortableFields(array $fields)

No description

array
getSortableFields()

No description

$this
setDefaultLimit($limit)

No description

int
getDefaultLimit()

No description

$this
setMaximumLimit($limit)

No description

string
getConnectionTypeName()

No description

string
getEdgeTypeName()

No description

array
args()

Pagination support for the connection type. Currently doesn't support cursors, just basic offset pagination.

array
fields()

No description

ObjectType
getEdgeType()

No description

ObjectType
toType()

No description

mixed
resolve(mixed $value, array $args, mixed $context, ResolveInfo $info)

Returns the collection resolved with the pageInfo provided.

array
resolveList(SS_List $list, array $args, null $context = null, ResolveInfo $info = null)

Wraps an {@link SS_List} with the required data in order to return it as a response. If you wish to resolve a standard array as a list use {@link ArrayList}.

Details

$this setPermissionChecker(QueryPermissionChecker $checker)

Parameters

QueryPermissionChecker $checker

Return Value

$this

__construct(string $connectionName)

Parameters

string $connectionName

$this setConnectionResolver($func)

Parameters

$func

Return Value

$this

$this setConnectionType(ObjectType|callable $type)

Pass in the {@link ObjectType}.

Parameters

ObjectType|callable $type

Type, or callable to evaluate type

Return Value

$this

ObjectType|callable getConnectionType(bool $evaluate = true)

Evaluate Connection type

Parameters

bool $evaluate

Return Value

ObjectType|callable

callable getConnectionResolver()

Return Value

callable

$this setArgs($args)

Parameters

$args

Return Value

$this

$this setDescription($string)

Parameters

$string

Return Value

$this

string getDescription()

Return Value

string

$this setSortableFields(array $fields)

Parameters

array $fields

See {@link $sortableFields}

Return Value

$this

array getSortableFields()

Return Value

array

$this setDefaultLimit($limit)

Parameters

$limit

Return Value

$this

int getDefaultLimit()

Return Value

int

$this setMaximumLimit($limit)

Parameters

$limit

Return Value

$this

string getConnectionTypeName()

Return Value

string

string getEdgeTypeName()

Return Value

string

array args()

Pagination support for the connection type. Currently doesn't support cursors, just basic offset pagination.

Return Value

array

array fields()

Return Value

array

ObjectType getEdgeType()

Return Value

ObjectType

ObjectType toType()

Return Value

ObjectType

mixed resolve(mixed $value, array $args, mixed $context, ResolveInfo $info)

Returns the collection resolved with the pageInfo provided.

Parameters

mixed $value
array $args
mixed $context
ResolveInfo $info

Return Value

mixed

Exceptions

Exception

array resolveList(SS_List $list, array $args, null $context = null, ResolveInfo $info = null)

Wraps an {@link SS_List} with the required data in order to return it as a response. If you wish to resolve a standard array as a list use {@link ArrayList}.

Parameters

SS_List $list
array $args
null $context
ResolveInfo $info

Return Value

array