Created
May 20, 2018 08:58
-
-
Save onurkose/32d4c9f8b93ac6b17e1bca7a06a68c40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\GraphQL\Types\System\TranslationManager; | |
// Project Model | |
use App\System\TranslationManager\Project\Project; | |
use GraphQL; | |
use GraphQL\Type\Definition\Type; | |
use Rebing\GraphQL\Support\Type as GraphQLType; | |
class ProjectsType extends GraphQLType | |
{ | |
protected $attributes = [ | |
'name' => 'ProjectsType', | |
'description' => 'A type of projects', | |
'model' => Project::class, | |
]; | |
public function fields() | |
{ | |
return [ | |
'id' => [ | |
'type' => Type::nonNull(Type::int()), | |
'description' => 'The id of the project' | |
], | |
'name' => [ | |
'type' => Type::string(), | |
'description' => 'The name of the project' | |
], | |
'status' => [ | |
'type' => Type::string(), | |
'description' => 'The status of the project' | |
], | |
'locales' => [ | |
'type' => Type::listOf(GraphQL::type('locales_type')), | |
'description' => 'A list of locales assigned to the project' | |
] | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment