Manager
class Manager implements ConfigurationApplier
Manager is the master container for a graphql endpoint, and contains all queries, mutations, and types.
Instantiate with {see Manager::createFromConfig()} with a config array.
Traits
Constants
QUERY_ROOT |
|
MUTATION_ROOT |
|
TYPES_ROOT |
|
Methods
No description
No description
No description
Build the main Schema instance that represents the final schema for this endpoint
Execute an arbitrary operation (mutation / query) on this schema.
Evaluate query via middleware
Register a new type
Return a type definition by name
No description
Get a query by name
Register a new mutation. Mutations can be callbacks to ensure dependent types are lazy-loaded.
Get a mutation by name
No description
No description
More verbose error display defaults.
Set the Member for the current context
Get the Member for the current context either from a previously set value or the current user
get query from persisted id, return null if not found
No description
Serialise a Graphql result object for output
Details
at line 94
QueryMiddleware[]
getMiddlewares()
at line 103
$this
setMiddlewares(QueryMiddleware[] $middlewares)
at line 113
$this
addMiddleware(QueryMiddleware $middleware)
at line 154
__construct(string $schemaKey = null)
at line 167
static Manager
createFromConfig($config, string $schemaKey = null)
deprecated
deprecated 4.0
at line 182
Manager
configure()
Applies a configuration based on the schemaKey property
at line 202
applyConfig(array $config)
at line 296
Schema
schema()
Build the main Schema instance that represents the final schema for this endpoint
at line 342
array
query(string $query, array $params = [])
Execute an arbitrary operation (mutation / query) on this schema.
Note because middleware may produce serialised responses we need to conditionally normalise to serialised array on output from object -> array.
at line 360
ExecutionResult|array
queryAndReturnResult(string $query, array $params = [])
Evaluate query via middleware
at line 379
addType(Type $type, string $name = '')
Register a new type
at line 394
Type
getType(string $name)
Return a type definition by name
at line 408
boolean
hasType(string $name)
at line 420
addQuery(array|Closure $query, string $name)
Register a new Query. Query can be defined as a closure to ensure dependent types are lazy loaded.
at line 431
array
getQuery(string $name)
Get a query by name
at line 443
addMutation(array|Closure $mutation, string $name)
Register a new mutation. Mutations can be callbacks to ensure dependent types are lazy-loaded.
at line 454
array
getMutation(string $name)
Get a mutation by name
at line 462
string
getSchemaKey()
at line 471
$this
setSchemaKey(string $schemaKey)
at line 503
static array
formatError(Error $exception)
More verbose error display defaults.
at line 530
$this
setMember(Member $member)
Set the Member for the current context
at line 541
Member
getMember()
Get the Member for the current context either from a previously set value or the current user
at line 552
string
getQueryFromPersistedID($id)
get query from persisted id, return null if not found
at line 588
$this
addContext(string $key, any $value)
at line 607
array
serialiseResult(ExecutionResult $executionResult)
Serialise a Graphql result object for output