SchemaConfig
in package
Schema configuration class.
Could be passed directly to schema constructor. List of options accepted by create method is described in docs.
Usage example:
$config = SchemaConfig::create()
->setQuery($myQueryType)
->setTypeLoader($myTypeLoader);
$schema = new Schema($config);
Table of Contents
- $assumeValid : bool
- $astNode : SchemaDefinitionNode|null
- $directives : array<string|int, Directive>|null
- $extensionASTNodes : array<string|int, SchemaTypeExtensionNode>
- $mutation : ObjectType|null
- $query : ObjectType|null
- $subscription : ObjectType|null
- $typeLoader : callable|null
- $types : array<string|int, Type>|callable
- create() : SchemaConfig
- Converts an array of options to instance of SchemaConfig (or just returns empty config when array is not passed).
- getAssumeValid() : bool
- getAstNode() : SchemaDefinitionNode|null
- getDirectives() : array<string|int, Directive>|null
- getExtensionASTNodes() : array<string|int, SchemaTypeExtensionNode>
- getMutation() : ObjectType|null
- getQuery() : ObjectType|null
- getSubscription() : ObjectType|null
- getTypeLoader() : callable|null
- getTypes() : array<string|int, Type>|callable
- setAssumeValid() : SchemaConfig
- setAstNode() : SchemaConfig
- setDirectives() : SchemaConfig
- setExtensionASTNodes() : mixed
- setMutation() : SchemaConfig
- setQuery() : SchemaConfig
- setSubscription() : SchemaConfig
- setTypeLoader() : SchemaConfig
- setTypes() : SchemaConfig
Properties
$assumeValid
public
bool
$assumeValid
= false
$astNode
public
SchemaDefinitionNode|null
$astNode
$directives
public
array<string|int, Directive>|null
$directives
$extensionASTNodes
public
array<string|int, SchemaTypeExtensionNode>
$extensionASTNodes
= []
$mutation
public
ObjectType|null
$mutation
$query
public
ObjectType|null
$query
$subscription
public
ObjectType|null
$subscription
$typeLoader
public
callable|null
$typeLoader
$types
public
array<string|int, Type>|callable
$types
= []
Methods
create()
Converts an array of options to instance of SchemaConfig (or just returns empty config when array is not passed).
public
static create([array<string|int, mixed> $options = [] ]) : SchemaConfig
Parameters
- $options : array<string|int, mixed> = []
Return values
SchemaConfig —getAssumeValid()
public
getAssumeValid() : bool
Return values
bool —getAstNode()
public
getAstNode() : SchemaDefinitionNode|null
Return values
SchemaDefinitionNode|null —getDirectives()
public
getDirectives() : array<string|int, Directive>|null
Return values
array<string|int, Directive>|null —getExtensionASTNodes()
public
getExtensionASTNodes() : array<string|int, SchemaTypeExtensionNode>
Return values
array<string|int, SchemaTypeExtensionNode> —getMutation()
public
getMutation() : ObjectType|null
Return values
ObjectType|null —getQuery()
public
getQuery() : ObjectType|null
Return values
ObjectType|null —getSubscription()
public
getSubscription() : ObjectType|null
Return values
ObjectType|null —getTypeLoader()
public
getTypeLoader() : callable|null
Return values
callable|null —getTypes()
public
getTypes() : array<string|int, Type>|callable
Return values
array<string|int, Type>|callable —setAssumeValid()
public
setAssumeValid(bool $assumeValid) : SchemaConfig
Parameters
- $assumeValid : bool
Return values
SchemaConfig —setAstNode()
public
setAstNode(SchemaDefinitionNode $astNode) : SchemaConfig
Parameters
- $astNode : SchemaDefinitionNode
Return values
SchemaConfig —setDirectives()
public
setDirectives(array<string|int, Directive> $directives) : SchemaConfig
Parameters
- $directives : array<string|int, Directive>
Return values
SchemaConfig —setExtensionASTNodes()
public
setExtensionASTNodes(array<string|int, SchemaTypeExtensionNode> $extensionASTNodes) : mixed
Parameters
- $extensionASTNodes : array<string|int, SchemaTypeExtensionNode>
Return values
mixed —setMutation()
public
setMutation(ObjectType|null $mutation) : SchemaConfig
Parameters
- $mutation : ObjectType|null
Return values
SchemaConfig —setQuery()
public
setQuery(ObjectType|null $query) : SchemaConfig
Parameters
- $query : ObjectType|null
Return values
SchemaConfig —setSubscription()
public
setSubscription(ObjectType|null $subscription) : SchemaConfig
Parameters
- $subscription : ObjectType|null
Return values
SchemaConfig —setTypeLoader()
public
setTypeLoader(callable $typeLoader) : SchemaConfig
Parameters
- $typeLoader : callable
Return values
SchemaConfig —setTypes()
public
setTypes(array<string|int, Type>|callable $types) : SchemaConfig
Parameters
- $types : array<string|int, Type>|callable