GqlInputSchema ​
- Type
- Class
- Namespace
- craft\gql
- Inherits
- craft\gql\GqlInputSchema
- Since
- 5.12.0
Describes the values GraphQL input types accept as JSON schemas.
Public Methods ​
| Method | Description |
|---|---|
| fromType() | Returns the JSON schema of the values a GraphQL input type accepts. |
| withNull() | Returns a schema that also accepts null. |
| withoutNull() | Returns a schema that doesn’t accept null. |
fromType() ​
Returns the JSON schema of the values a GraphQL input type accepts.
Input object types with an isOneOf config value accept exactly one of their fields. Input object fields with an inputSchema config value accept the values that schema describes, rather than the ones their type does.
Arguments ​
$definition(\GraphQL\Type\Definition\Type,array<string,mixed>) – A type, or a field definition with atypeand an optionaldescription.
Returns ​
array<string,mixed>
withNull() ​
Returns a schema that also accepts null.
Arguments ​
$schema(array<string,mixed>)
Returns ​
array<string,mixed>
withoutNull() ​
Returns a schema that doesn’t accept null.
Arguments ​
$schema(array<string,mixed>)
Returns ​
array<string,mixed>