Skip to content

Commit dbd4f64

Browse files
committed
fix(graphql): docs should answer text/html
1 parent 51b8183 commit dbd4f64

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

features/graphql/docs.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Feature: Documentation support
2+
In order to play with GraphQL
3+
As a client software developer
4+
I want to reach the GraphQL documentation
5+
6+
Scenario: Retrieve the OpenAPI documentation
7+
Given I add "Accept" header equal to "text/html"
8+
And I send a "GET" request to "/graphql"
9+
Then the response status code should be 200
10+
And the header "Content-Type" should be equal to "text/html; charset=utf-8"

src/GraphQl/Action/GraphQlPlaygroundAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __invoke(Request $request): Response
3737
'title' => $this->title,
3838
'graphql_playground_data' => ['entrypoint' => $this->router->generate('api_graphql_entrypoint')],
3939
'assetPackage' => $this->assetPackage,
40-
]));
40+
]), 200, ['content-type' => 'text/html']);
4141
}
4242

4343
throw new BadRequestHttpException('GraphQL Playground is not enabled.');

src/GraphQl/Action/GraphiQlAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __invoke(Request $request): Response
3737
'title' => $this->title,
3838
'graphiql_data' => ['entrypoint' => $this->router->generate('api_graphql_entrypoint')],
3939
'assetPackage' => $this->assetPackage,
40-
]));
40+
]), 200, ['content-type' => 'text/html']);
4141
}
4242

4343
throw new BadRequestHttpException('GraphiQL is not enabled.');

0 commit comments

Comments
 (0)