Skip to content

Commit 16400cc

Browse files
authored
Fix hardcoded route in UI action
1 parent 572a5bd commit 16400cc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/GraphQLController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ public function graphql(Request $request) : JsonResponse
6464
}
6565

6666
#[Route('/ui', name: 'ui', methods: ['GET'])]
67-
public function ui() : Response
67+
public function ui(Request $request) : Response
6868
{
69+
$graphQlRoute = \rtrim($request->get('_route'), 'ui') . 'graphql';
70+
6971
return $this->render('@Graphpinator/ui.html.twig', [
70-
'schemaUrl' => $this->urlGenerator->generate('graphql_default_graphql', [], UrlGeneratorInterface::ABSOLUTE_URL),
72+
'schemaUrl' => $this->urlGenerator->generate($graphQlRoute, [], UrlGeneratorInterface::ABSOLUTE_URL),
7173
]);
7274
}
7375

0 commit comments

Comments
 (0)