From f6a9c3233fca009e5606b6543f632e0362fdbe56 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 19 Jun 2020 10:59:51 +0200 Subject: [PATCH] Use snake case for pagination type --- src/DataProvider/Pagination.php | 2 +- tests/Fixtures/TestBundle/Document/FooDummy.php | 2 +- tests/Fixtures/TestBundle/Entity/FooDummy.php | 2 +- tests/GraphQl/Type/FieldsBuilderTest.php | 2 +- tests/GraphQl/Type/TypeBuilderTest.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/DataProvider/Pagination.php b/src/DataProvider/Pagination.php index 6564b955456..ff2c19c2c7a 100644 --- a/src/DataProvider/Pagination.php +++ b/src/DataProvider/Pagination.php @@ -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); } /** diff --git a/tests/Fixtures/TestBundle/Document/FooDummy.php b/tests/Fixtures/TestBundle/Document/FooDummy.php index 90c9de2aec8..e29794ceb44 100644 --- a/tests/Fixtures/TestBundle/Document/FooDummy.php +++ b/tests/Fixtures/TestBundle/Document/FooDummy.php @@ -26,7 +26,7 @@ * "order"={"dummy.name"} * }, * graphql={ - * "collection_query"={"paginationType"="page"} + * "collection_query"={"pagination_type"="page"} * } * ) * @ODM\Document diff --git a/tests/Fixtures/TestBundle/Entity/FooDummy.php b/tests/Fixtures/TestBundle/Entity/FooDummy.php index 1ec0a15a8cb..83bb02a55f2 100644 --- a/tests/Fixtures/TestBundle/Entity/FooDummy.php +++ b/tests/Fixtures/TestBundle/Entity/FooDummy.php @@ -26,7 +26,7 @@ * "order"={"dummy.name"} * }, * graphql={ - * "collection_query"={"paginationType"="page"} + * "collection_query"={"pagination_type"="page"} * } * ) * @ORM\Entity diff --git a/tests/GraphQl/Type/FieldsBuilderTest.php b/tests/GraphQl/Type/FieldsBuilderTest.php index ee4001044db..f460bd3d927 100644 --- a/tests/GraphQl/Type/FieldsBuilderTest.php +++ b/tests/GraphQl/Type/FieldsBuilderTest.php @@ -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' => [ diff --git a/tests/GraphQl/Type/TypeBuilderTest.php b/tests/GraphQl/Type/TypeBuilderTest.php index 1721122fcda..7b60708d377 100644 --- a/tests/GraphQl/Type/TypeBuilderTest.php +++ b/tests/GraphQl/Type/TypeBuilderTest.php @@ -436,7 +436,7 @@ public function testCursorBasedGetResourcePaginatedCollectionType(): void null, null, null, - ['paginationType' => 'cursor'] + ['pagination_type' => 'cursor'] )); /** @var ObjectType $resourcePaginatedCollectionType */ @@ -498,7 +498,7 @@ public function testPageBasedGetResourcePaginatedCollectionType(): void null, null, null, - ['paginationType' => 'page'] + ['pagination_type' => 'page'] )); /** @var ObjectType $resourcePaginatedCollectionType */