Skip to content

Commit

Permalink
fix: renderVoyager
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaticMuch committed Sep 4, 2023
1 parent de3e0dc commit 9c405f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example/cdn/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
width: 100%;
overflow: hidden;
}

#voyager {
height: 100vh;
}
Expand All @@ -24,10 +25,11 @@
/>
<script src="https://cdn.jsdelivr.net/npm/graphql-voyager/dist/voyager.standalone.js"></script>
</head>

<body>
<div id="voyager">Loading...</div>
<script type="module">
const { init, voyagerIntrospectionQuery: query } = GraphQLVoyager;
const { voyagerIntrospectionQuery: query } = GraphQLVoyager;
const response = await fetch(
'https://swapi-graphql.netlify.app/.netlify/functions/index',
{
Expand All @@ -43,7 +45,7 @@
const introspection = await response.json();

// Render <Voyager /> into the body.
GraphQLVoyager.init(document.getElementById('voyager'), {
GraphQLVoyager.renderVoyager(document.getElementById('voyager'), {
introspection,
});
</script>
Expand Down

0 comments on commit 9c405f5

Please sign in to comment.