Skip to content

Commit

Permalink
fix: JS middleware page (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fllorent0D authored Sep 9, 2023
1 parent 7a17faa commit b534f73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/middleware/render-voyager-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default function renderVoyagerPage(options: MiddlewareOptions) {
<h1 style="text-align: center; color: #5d7e86;"> Loading... </h1>
</main>
<script type="module">
window.addEventListener('load', function(event) {
const response = fetch('${endpointUrl}', {
window.addEventListener('load', async function(event) {
const response = await fetch('${endpointUrl}', {
method: 'post',
headers: Object.assign({}, {
'Accept': 'application/json',
Expand All @@ -52,7 +52,7 @@ export default function renderVoyagerPage(options: MiddlewareOptions) {
});
const introspection = await response.json();
GraphQLVoyager.init(document.getElementById('voyager'), {
GraphQLVoyager.renderVoyager(document.getElementById('voyager'), {
introspection,
displayOptions: ${JSON.stringify(displayOptions)},
});
Expand Down

0 comments on commit b534f73

Please sign in to comment.