A collection of generic types for use with webonyx/graphql-php
$schema = BuildSchema::build($source, TypeConfigDecorator::resolve());
If you already have a type config decorator, you can add specific types to your current type config decorator:
...
switch($typeConfig['name']) {
case 'UUID':
$typeConfig = array_merge($typeConfig, UuidType::config());
break;
}
...
You can also just add types directly
$uuid = new UuidType();
The DateTime
scalar type represents time data, represented as an ISO-8601 encoded UTC date string.
GraphQL definition:
scalar DateTime
Query result:
{
"data": {
"record": {
"dateTime": "2020-11-05T12:33:45+00:00"
}
}
}
Standard email validation
GraphQL definition:
scalar Email
The Money
scalar type represents the lowest denominator of a currency.
Will resolve to moneyphp/money type.
GraphQL definition:
scalar Money
The UUID
scalar type represents a universally unique identifier (UUID).
Will resolve to ramsey/uuid type.
GraphQL definition:
scalar UUID
URL
a Uniform Resource Locator.
GraphQL definition:
scalar URL