Skip to content

Commit e7dad31

Browse files
authored
Use snake case for pagination type (#3614)
1 parent ccdbb5f commit e7dad31

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/DataProvider/Pagination.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function getGraphQlPaginationType(string $resourceClass, string $operatio
215215
return 'cursor';
216216
}
217217

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

221221
/**

tests/Fixtures/TestBundle/Document/FooDummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* "order"={"dummy.name"}
2727
* },
2828
* graphql={
29-
* "collection_query"={"paginationType"="page"}
29+
* "collection_query"={"pagination_type"="page"}
3030
* }
3131
* )
3232
* @ODM\Document

tests/Fixtures/TestBundle/Entity/FooDummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* "order"={"dummy.name"}
2727
* },
2828
* graphql={
29-
* "collection_query"={"paginationType"="page"}
29+
* "collection_query"={"pagination_type"="page"}
3030
* }
3131
* )
3232
* @ORM\Entity

tests/GraphQl/Type/FieldsBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public function collectionQueryFieldsProvider(): array
335335
],
336336
],
337337
],
338-
'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 () {
338+
'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 () {
339339
},
340340
[
341341
'actionShortNames' => [

tests/GraphQl/Type/TypeBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public function testCursorBasedGetResourcePaginatedCollectionType(): void
436436
null,
437437
null,
438438
null,
439-
['paginationType' => 'cursor']
439+
['pagination_type' => 'cursor']
440440
));
441441

442442
/** @var ObjectType $resourcePaginatedCollectionType */
@@ -498,7 +498,7 @@ public function testPageBasedGetResourcePaginatedCollectionType(): void
498498
null,
499499
null,
500500
null,
501-
['paginationType' => 'page']
501+
['pagination_type' => 'page']
502502
));
503503

504504
/** @var ObjectType $resourcePaginatedCollectionType */

0 commit comments

Comments
 (0)