Skip to content

Commit d2b1b96

Browse files
authored
Merge pull request #2524 from soyuka/merging
Merging #1906 #2000
2 parents d96b52a + a508fec commit d2b1b96

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Bridge/Doctrine/Orm/Extension/EagerLoadingExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private function apply(bool $collection, QueryBuilder $queryBuilder, QueryNameGe
126126
private function joinRelations(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, bool $forceEager, bool $fetchPartial, string $parentAlias, array $options = [], array $normalizationContext = [], bool $wasLeftJoin = false, int &$joinCount = 0, int $currentDepth = null)
127127
{
128128
if ($joinCount > $this->maxJoins) {
129-
throw new RuntimeException('The total number of joined relations has exceeded the specified maximum. Raise the limit if necessary, or use the "max_depth" option of the Symfony serializer.');
129+
throw new RuntimeException('The total number of joined relations has exceeded the specified maximum. Raise the limit if necessary with the "api_platform.eager_loading.max_joins" configuration key (https://api-platform.com/docs/core/performance/#eager-loading), or limit the maximum serialization depth using the "enable_max_depth" option of the Symfony serializer (https://symfony.com/doc/current/components/serializer.html#handling-serialization-depth).');
130130
}
131131

132132
$currentDepth = $currentDepth > 0 ? $currentDepth - 1 : $currentDepth;

src/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ public function load(array $configs, ContainerBuilder $container)
134134
$this->registerOAuthConfiguration($container, $config);
135135
$this->registerApiKeysConfiguration($container, $config);
136136
$this->registerSwaggerConfiguration($container, $config, $loader);
137-
$this->registerJsonApiConfiguration($formats, $loader);
138137
$this->registerJsonLdConfiguration($container, $formats, $loader, $config['enable_docs']);
138+
$this->registerGraphqlConfiguration($container, $config, $loader);
139139
$this->registerJsonHalConfiguration($formats, $loader);
140140
$this->registerJsonProblemConfiguration($errorFormats, $loader);
141-
$this->registerGraphqlConfiguration($container, $config, $loader);
141+
$this->registerJsonApiConfiguration($formats, $loader);
142142
$this->registerBundlesConfiguration($bundles, $config, $loader);
143143
$this->registerCacheConfiguration($container);
144144
$this->registerDoctrineConfiguration($container, $config, $loader, $useDoctrine);

tests/Bridge/Doctrine/Orm/Extension/EagerLoadingExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public function testDenormalizeItemWithExistingGroups()
330330
public function testMaxJoinsReached()
331331
{
332332
$this->expectException(RuntimeException::class);
333-
$this->expectExceptionMessage('The total number of joined relations has exceeded the specified maximum. Raise the limit if necessary, or use the "max_depth" option of the Symfony serializer.');
333+
$this->expectExceptionMessage('The total number of joined relations has exceeded the specified maximum. Raise the limit if necessary with the "api_platform.eager_loading.max_joins" configuration key (https://api-platform.com/docs/core/performance/#eager-loading), or limit the maximum serialization depth using the "enable_max_depth" option of the Symfony serializer (https://symfony.com/doc/current/components/serializer.html#handling-serialization-depth).');
334334

335335
$resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class);
336336
$resourceMetadataFactoryProphecy->create(Dummy::class)->willReturn(new ResourceMetadata());

0 commit comments

Comments
 (0)