Connection
class Connection implements OperationResolver
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
An implementation of the factory method, allows you to create an instance of a class
Creates a class instance by the "singleton" design pattern.
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
in Injectable at line 26
static Injectable
create(array $args)
An implementation of the factory method, allows you to create an instance of a class
This method will defer class substitution to the Injector API, which can be customised via the Config API to declare substitution classes.
This can be called in one of two ways - either calling via the class directly, or calling on Object and passing the class name as the first parameter. The following are equivalent: $list = DataList::create('SiteTree'); $list = SiteTree::get();
in Injectable at line 43
static Injectable
singleton(string $class = null)
Creates a class instance by the "singleton" design pattern.
It will always return the same instance for this class, which can be used for performance reasons and as a simple way to access instance methods which don't rely on instance data (e.g. the custom SilverStripe static handling).
in PermissionCheckerAware at line 17
$this
setPermissionChecker(QueryPermissionChecker $checker)
in PermissionCheckerAware at line 27
QueryPermissionChecker
getPermissionChecker()
at line 91
__construct(string $connectionName)
at line 101
$this
setConnectionResolver(Callable $func)
at line 114
$this
setConnectionType(ObjectType|Callable $type)
Pass in the {@link ObjectType}.
at line 127
ObjectType|Callable
getConnectionType(bool $evaluate = true)
Evaluate Connection type
at line 137
Callable
getConnectionResolver()
at line 147
$this
setArgs(array|Callable $args)
at line 159
$this
setDescription(string $string)
at line 169
string
getDescription()
at line 178
$this
setSortableFields(array $fields)
at line 190
array
getSortableFields()
at line 200
$this
setDefaultLimit(int $limit)
at line 210
int
getDefaultLimit()
at line 220
$this
setMaximumLimit(int $limit)
at line 230
string
getConnectionTypeName()
at line 238
string
getEdgeTypeName()
at line 249
array
args()
Pagination support for the connection type. Currently doesn't support cursors, just basic offset pagination.
at line 282
array
fields()
at line 301
ObjectType
getEdgeType()
at line 327
ObjectType
toType()
at line 348
mixed
resolve(mixed $value, array $args, mixed $context, ResolveInfo $info)
Returns the collection resolved with the pageInfo provided.
at line 373
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}.