Skip to content

Instantly share code, notes, and snippets.

@onurkose
Last active May 20, 2018 08:55
Show Gist options
  • Save onurkose/45f04328314d35983a1054265abaaf5e to your computer and use it in GitHub Desktop.
Save onurkose/45f04328314d35983a1054265abaaf5e to your computer and use it in GitHub Desktop.
How to mutate Arrays of Objects with vue-apollo
<?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