Array input
drmax24 opened this issue · comments
drmax24 commented
Do we have a simple way to define a simple array of scalars in the input handler?
Here is an example of laravel rebing/graphql query arguments.
I have an argument named ids that is an array of ids
I can easily define an array input without creating a custom input type.
public function args(): array
{
return [
'ids' => [
'type' => Type::listOf(Type::int()),
],
Do we have anything similar?
drmax24 commented
It kinda works. But how to make ids argument to be optional?
/**
* @param string[] $ids
*/
#[Query(
name: 'groups',
outputType: '[CommunityGroup]',
)]
public function resolve(?array $ids = null, int $offset = 0, int $limit = 10): \Generator
ids is not optional in graphql schema