Connection
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
No description
No description
Pass in the {@link ObjectType}.
Evaluate Connection type
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Pagination support for the connection type. Currently doesn't support cursors, just basic offset pagination.
No description
No description
No description
Returns the collection resolved with the pageInfo provided.
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)
QueryPermissionChecker
getPermissionChecker()
__construct(string $connectionName)
$this
setConnectionResolver($func)
$this
setConnectionType(ObjectType|callable $type)
Pass in the {@link ObjectType}.
ObjectType|callable
getConnectionType(bool $evaluate = true)
Evaluate Connection type
callable
getConnectionResolver()
$this
setArgs($args)
$this
setDescription($string)
string
getDescription()
$this
setSortableFields(array $fields)
array
getSortableFields()
$this
setDefaultLimit($limit)
int
getDefaultLimit()
$this
setMaximumLimit($limit)
string
getConnectionTypeName()
string
getEdgeTypeName()
array
args()
Pagination support for the connection type. Currently doesn't support cursors, just basic offset pagination.
array
fields()
ObjectType
getEdgeType()
ObjectType
toType()
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}.