Last active
May 20, 2018 08:55
-
-
Save onurkose/45f04328314d35983a1054265abaaf5e to your computer and use it in GitHub Desktop.
How to mutate Arrays of Objects with vue-apollo
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\Localization; | |
// Locale Model | |
use App\System\Localization\Locale; | |
use GraphQL\Type\Definition\Type; | |
use Rebing\GraphQL\Support\Type as GraphQLType; | |
class LocalesType extends GraphQLType | |
{ | |
protected $attributes = [ | |
'name' => 'Locales', | |
'description' => 'A type of locale', | |
'model' => Locale::class, | |
]; | |
public function fields() | |
{ | |
return [ | |
'id' => [ | |
'type' => Type::nonNull(Type::int()), | |
'description' => 'The id of the project' | |
], | |
'identifier' => [ | |
'type' => Type::string(), | |
'description' => 'The identifier of the locale' | |
], | |
'description' => [ | |
'type' => Type::string(), | |
'description' => 'The description of the locale' | |
] | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment