Skip to content

Commit

Permalink
fix(explorer): Show message if introspection is disbaled (#1349)
Browse files Browse the repository at this point in the history
  • Loading branch information
acbramley authored Nov 11, 2023
1 parent 6798e26 commit 72476b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Controller/ExplorerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ public function viewExplorer(ServerInterface $graphql_server, Request $request)
$url = $this->urlGenerator->generate("graphql.query.{$graphql_server->id()}");
$introspectionData = $this->introspection->introspect($graphql_server);

if ($graphql_server->get('disable_introspection')) {
return [
'#type' => 'markup',
'#markup' => $this->t('Introspection is disabled for this server, enable it to use the Explorer.'),
];
}

return [
'#type' => 'markup',
'#markup' => '<div id="graphql-explorer"></div>',
Expand Down

0 comments on commit 72476b9

Please sign in to comment.