Skip to content

Commit

Permalink
Use snake case for pagination type (#3614)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpoulain committed Jun 19, 2020
1 parent ccdbb5f commit e7dad31
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/DataProvider/Pagination.php
Expand Up @@ -215,7 +215,7 @@ public function getGraphQlPaginationType(string $resourceClass, string $operatio
return 'cursor';
}

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

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/TestBundle/Document/FooDummy.php
Expand Up @@ -26,7 +26,7 @@
* "order"={"dummy.name"}
* },
* graphql={
* "collection_query"={"paginationType"="page"}
* "collection_query"={"pagination_type"="page"}
* }
* )
* @ODM\Document
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/TestBundle/Entity/FooDummy.php
Expand Up @@ -26,7 +26,7 @@
* "order"={"dummy.name"}
* },
* graphql={
* "collection_query"={"paginationType"="page"}
* "collection_query"={"pagination_type"="page"}
* }
* )
* @ORM\Entity
Expand Down
2 changes: 1 addition & 1 deletion tests/GraphQl/Type/FieldsBuilderTest.php
Expand Up @@ -335,7 +335,7 @@ public function collectionQueryFieldsProvider(): array
],
],
],
'collection with page-based pagination enabled' => ['resourceClass', (new ResourceMetadata('ShortName', null, null, null, null, ['paginationType' => 'page']))->withGraphql(['action' => ['filters' => ['my_filter']]]), 'action', [], $graphqlType = GraphQLType::listOf(new ObjectType(['name' => 'collection'])), $resolver = function () {
'collection with page-based pagination enabled' => ['resourceClass', (new ResourceMetadata('ShortName', null, null, null, null, ['pagination_type' => 'page']))->withGraphql(['action' => ['filters' => ['my_filter']]]), 'action', [], $graphqlType = GraphQLType::listOf(new ObjectType(['name' => 'collection'])), $resolver = function () {
},
[
'actionShortNames' => [
Expand Down
4 changes: 2 additions & 2 deletions tests/GraphQl/Type/TypeBuilderTest.php
Expand Up @@ -436,7 +436,7 @@ public function testCursorBasedGetResourcePaginatedCollectionType(): void
null,
null,
null,
['paginationType' => 'cursor']
['pagination_type' => 'cursor']
));

/** @var ObjectType $resourcePaginatedCollectionType */
Expand Down Expand Up @@ -498,7 +498,7 @@ public function testPageBasedGetResourcePaginatedCollectionType(): void
null,
null,
null,
['paginationType' => 'page']
['pagination_type' => 'page']
));

/** @var ObjectType $resourcePaginatedCollectionType */
Expand Down

0 comments on commit e7dad31

Please sign in to comment.