question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use the pre-bundled version

See original GitHub issue

I don’t know exactly how to use the prebundled version, I tried the following so far

<!DOCTYPE html>
<html>
  <head>
    <script src="//cdn.jsdelivr.net/react/15.4.2/react.min.js"></script>
    <script src="//cdn.jsdelivr.net/react/15.4.2/react-dom.min.js"></script>

    <link rel="stylesheet" href="./node_modules/graphql-voyager/dist/voyager.css" />
    <script src="./node_modules/graphql-voyager/dist/voyager.min.js"></script>
  </head>
  <body>
    <div id="voyager">Loading...</div>
    <script>
      function introspectionProvider(introspectionQuery) {
        // This example expects a GraphQL server at the path /graphql.
        // Change this to point wherever you host your GraphQL server.
        return fetch('http://127.0.0.1:8000/graphql', {
          method: 'post',
          headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({query: introspectionQuery}),
          credentials: 'include',
        }).then(function (response) {
          return response.text();
        }).then(function (responseBody) {
          try {
            return JSON.parse(responseBody);
          } catch (error) {
            return responseBody;
          }
        });
      }

      // Render <Voyager />
      GraphQLVoyager.init(document.getElementById('voyager'), {
        introspection: introspectionProvider
      })
    </script>
  </body>
</html>

What else do I need to do, if I want to use only de CDNs

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
RomanHotsiycommented, Mar 22, 2018

@sgaseretto you are opening page from file-system, that’s why // in the url is treated as file:///. To fix the issue add http:// to script urls:

<script src="https://cdn.jsdelivr.net/react/15.4.2/react.min.js"></script>
<script src="https://cdn.jsdelivr.net/react/15.4.2/react-dom.min.js"></script>

and same for other scripts

I have updated the example /example/index.html@master

1reaction
IvanGoncharovcommented, Mar 22, 2018

@sgaseretto If you just want to use it locally, try our demo: https://apis.guru/graphql-voyager/ You can select “Custom introspection” like here: image

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the pre-bundled version · Issue #58 - GitHub
I don't know exactly how to use the prebundled version, I tried the following so far.
Read more >
Dependency Pre-Bundling - Vite
If for some reason you want to force Vite to re-bundle deps, you can either start the dev server with the --force command...
Read more >
webpack-prebundle-plugin - npm
A webpack plugin for prebundling your vendors and common code on the fly. Powered by esbuild.. Latest version: 1.0.2, last published: 2 ...
Read more >
Cannot use pre-bundled map in newest SDK version (Android)
I've been using Skobbler SDK version 2.5.1 to pre-bundle a map on my app. When I wanted to upload my app to the...
Read more >
2 Installation - MIT
For MiKTEX, use the update wizard to install the (latest versions of the) packages called pgf, xcolor, and xkeyval.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found