An open API service indexing awesome lists of open source software.

https://github.com/mathsgod/gql-scalar-email


https://github.com/mathsgod/gql-scalar-email

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

README

          

# gql-scalar-email

```php

$gql = "
scalar Email
type Query{
test(email:Email):Email
}
";

$typeConfigDecorator = function ($typeConfig) {
$name = $typeConfig['name'];

if ($name === 'Email') {
$email = new Scalar\Email();

$typeConfig["serialize"] = [$email, "serialize"];
$typeConfig["parseLiteral"] = [$email, "parseLiteral"];
}
return $typeConfig;
};

$schema = BuildSchema::build($gql, $typeConfigDecorator);
```