laravel-graphql
laravel-graphql copied to clipboard
Create querries and mutations anonymously
I will submit a PR for this if the team believe its a good addition.
Currently you can create types anonymously like this
GraphQL::addType(new class extends BaseType {
protected $attributes = [
'name' => 'HeartRate',
'description' => 'A type'
];
public function fields()
{
return [
'uuid' => [
'type' => Type::ID()
],
'pulse' => [
'type' => Type::string()
]
];
}
});
It would be nice to be able to do this for querries and mutations as well, however there is no way to access the underlying instance object for the querries or mutations.