-
-
Notifications
You must be signed in to change notification settings - Fork 269
Closed
Description
Versions:
- graphql-laravel Version: all with current
- Laravel Version: 8.77.1
- PHP Version:8.0
Description:
I want to make the list (data) and type inside the paginator to be required. But there is a problem with the possible selectable fields. This is due to the lack of a recursion parameter when calling the getWrappedType method in the SelectFields class on line 188. If you pass an argument to the getWrappedType method to retrieve data recursively, everything will work correctly.
like this
if (is_a($parentType, Config::get('graphql.pagination_type', PaginationType::class)) ||
is_a($parentType, Config::get('graphql.simple_pagination_type', SimplePaginationType::class))) {
/* @var GraphqlType $fieldType */
$fieldType = $fieldObject->config['type'];
static::handleFields(
$queryArgs,
$field,
$fieldType->getWrappedType(true), //<---
$select,
$with,
$ctx
);
}
Steps To Reproduce:
public function type(): Type
{
return GraphQL::paginate(
Type::nonNull(
GraphQL::type('someType')
)
);
}
and inside extends PaginationType
protected function getPaginationFields(string $typeName): array
{
return [
'data' => [
'type' => Type::nonNull(
Type::listOf(
GraphQL::type($typeName)
)
),
...