Skip to content

Commit 3bbc61e

Browse files
authored
chore(graphql): deprecate GraphQL Playground (api-platform#5309)
1 parent bf8fe48 commit 3bbc61e

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,9 @@ private function registerGraphQlConfiguration(ContainerBuilder $container, array
468468

469469
$graphiqlEnabled = $enabled && $this->isConfigEnabled($container, $config['graphql']['graphiql']);
470470
$graphqlPlayGroundEnabled = $enabled && $this->isConfigEnabled($container, $config['graphql']['graphql_playground']);
471+
if ($graphqlPlayGroundEnabled) {
472+
trigger_deprecation('api-platform/core', '3.1', 'GraphQL Playground is deprecated and will be removed in API Platform 4.0. Only GraphiQL will be available in the future.');
473+
}
471474

472475
$container->setParameter('api_platform.graphql.enabled', $enabled);
473476
$container->setParameter('api_platform.graphql.graphiql.enabled', $graphiqlEnabled);

src/Symfony/Bundle/Resources/views/SwaggerUi/index.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
{% if swaggerUiEnabled and active_ui != 'swagger_ui' %}<a href="{{ path('api_doc') }}">Swagger UI</a>{% endif %}
8686
{% if reDocEnabled and active_ui != 're_doc' %}<a href="{{ path('api_doc', {'ui': 're_doc'}) }}">ReDoc</a>{% endif %}
8787
{% if not graphQlEnabled or graphiQlEnabled %}<a {% if graphiQlEnabled %}href="{{ path('api_graphql_graphiql') }}"{% endif %} class="graphiql-link">GraphiQL</a>{% endif %}
88-
{% if graphQlPlaygroundEnabled %}<a href="{{ path('api_graphql_graphql_playground') }}">GraphQL Playground</a>{% endif %}
88+
{% if graphQlPlaygroundEnabled %}<a href="{{ path('api_graphql_graphql_playground') }}">GraphQL Playground (deprecated)</a>{% endif %}
8989
</div>
9090
</div>
9191
</div>

tests/Fixtures/app/AppKernel.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ class_exists(NativePasswordHasher::class) ? 'password_hashers' : 'encoders' => [
236236
'mapping' => [
237237
'paths' => ['%kernel.project_dir%/../TestBundle/Resources/config/api_resources'],
238238
],
239+
'graphql' => [
240+
'graphql_playground' => false,
241+
],
239242
]);
240243

241244
$loader->load(__DIR__.'/config/config_swagger.php');

tests/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ class ApiPlatformExtensionTest extends TestCase
153153
'asset_package' => null,
154154
'enable_entrypoint' => true,
155155
'enable_docs' => true,
156+
'graphql' => [
157+
'graphql_playground' => ['enabled' => false],
158+
],
156159
]];
157160

158161
private ContainerBuilder $container;

0 commit comments

Comments
 (0)