Skip to content

Instantly share code, notes, and snippets.

@onurkose
Created May 20, 2018 09:05
Show Gist options
  • Save onurkose/9f765286103831811b1b13c53a2493c5 to your computer and use it in GitHub Desktop.
Save onurkose/9f765286103831811b1b13c53a2493c5 to your computer and use it in GitHub Desktop.
<?php
namespace App\GraphQL\Types\InputObjects;
use GraphQL\Type\Definition\Type;
use Rebing\GraphQL\Support\Type as GraphQLType;
class LocaleInputObjectType extends GraphQLType
{
protected $inputObject = true;
protected $attributes = [
'name' => 'LocaleInputObjectType',
'description' => 'A type of project locales'
];
public function fields()
{
return [
'id' => [
'type' => Type::nonNull(Type::id()),
'description' => 'The id of the locale'
],
'identifier' => [
'type' => Type::string(),
'description' => 'The identifier of the locale'
],
'description' => [
'type' => Type::string(),
'description' => 'The description of the locale'
],
'__typename' => [
'type' => Type::string(),
'description' => 'Apollo sends it, ignore'
],
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment