Skip to content

Commit

Permalink
[GraphQL] Fix getGraphQlPaginationType when not a resource (#3328)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpoulain committed Dec 23, 2019
1 parent 5acdef3 commit 9298c45
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/DataProvider/Pagination.php
Expand Up @@ -203,7 +203,11 @@ public function getOptions(): array

public function getGraphQlPaginationType(string $resourceClass, string $operationName): string
{
$resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
try {
$resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
} catch (ResourceClassNotFoundException $e) {
return 'cursor';
}

return (string) $resourceMetadata->getGraphqlAttribute($operationName, 'paginationType', 'cursor', true);
}
Expand Down

0 comments on commit 9298c45

Please sign in to comment.