Resolver
in package
Defines a class that maps/resolves GraphQL queries and mutations to the appropriate Model methods.
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructs the GraphQLResolver object with a given Model object.
- check_privs() : void
- Checks if authenticated user has privileges to perform the requested action.
- create() : array<string|int, mixed>
- A resolver that maps a GraphQL mutation to the Model's 'create' method.
- delete() : array<string|int, mixed>
- A resolver that maps a GraphQL mutation to the Model's 'delete' method.
- delete_all() : array<string|int, mixed>
- A resolver that maps a GraphQL mutation to the Model's 'delete_all' method.
- delete_many() : array<string|int, mixed>
- A resolver that maps a GraphQL mutation to the Model's 'delete_many' method.
- query() : array<string|int, mixed>
- A resolver that maps a GraphQL query to the Model's 'query' method.
- read() : array<string|int, mixed>
- A resolver that maps a GraphQL query to the Model's 'read' method.
- replace_all() : array<string|int, mixed>
- A resolver that maps a GraphQL mutation to the Model's 'replace_all' method.
- update() : array<string|int, mixed>
- A resolver that maps a GraphQL mutation to the Model's 'update' method.
Properties
$model
public
Model
$model
Methods
__construct()
Constructs the GraphQLResolver object with a given Model object.
public
__construct(Model $model) : mixed
Parameters
- $model : Model
-
The Model object to be used for resolving queries and mutations.
check_privs()
Checks if authenticated user has privileges to perform the requested action.
public
check_privs(string $resolver, Auth $auth) : void
Parameters
- $resolver : string
-
The resolver method to check permissions for.
- $auth : Auth
-
The Auth object to use for checking permissions.
Tags
create()
A resolver that maps a GraphQL mutation to the Model's 'create' method.
public
create(mixed $root, mixed $args, mixed $context, mixed $info) : array<string|int, mixed>
Parameters
- $root : mixed
- $args : mixed
- $context : mixed
- $info : mixed
Tags
Return values
array<string|int, mixed>delete()
A resolver that maps a GraphQL mutation to the Model's 'delete' method.
public
delete(mixed $root, mixed $args, mixed $context, mixed $info) : array<string|int, mixed>
Parameters
- $root : mixed
- $args : mixed
- $context : mixed
- $info : mixed
Tags
Return values
array<string|int, mixed>delete_all()
A resolver that maps a GraphQL mutation to the Model's 'delete_all' method.
public
delete_all(mixed $root, mixed $args, mixed $context, mixed $info) : array<string|int, mixed>
Parameters
- $root : mixed
- $args : mixed
- $context : mixed
- $info : mixed
Tags
Return values
array<string|int, mixed>delete_many()
A resolver that maps a GraphQL mutation to the Model's 'delete_many' method.
public
delete_many(mixed $root, mixed $args, mixed $context, mixed $info) : array<string|int, mixed>
Parameters
- $root : mixed
- $args : mixed
- $context : mixed
- $info : mixed
Tags
Return values
array<string|int, mixed>query()
A resolver that maps a GraphQL query to the Model's 'query' method.
public
query(mixed $root, mixed $args, mixed $context, mixed $info) : array<string|int, mixed>
Parameters
- $root : mixed
- $args : mixed
- $context : mixed
- $info : mixed
Tags
Return values
array<string|int, mixed>read()
A resolver that maps a GraphQL query to the Model's 'read' method.
public
read(mixed $root, mixed $args, mixed $context, mixed $info) : array<string|int, mixed>
Parameters
- $root : mixed
- $args : mixed
- $context : mixed
- $info : mixed
Tags
Return values
array<string|int, mixed>replace_all()
A resolver that maps a GraphQL mutation to the Model's 'replace_all' method.
public
replace_all(mixed $root, mixed $args, mixed $context, mixed $info) : array<string|int, mixed>
Parameters
- $root : mixed
- $args : mixed
- $context : mixed
- $info : mixed
Tags
Return values
array<string|int, mixed>update()
A resolver that maps a GraphQL mutation to the Model's 'update' method.
public
update(mixed $root, mixed $args, mixed $context, mixed $info) : array<string|int, mixed>
Parameters
- $root : mixed
- $args : mixed
- $context : mixed
- $info : mixed