How to use the pre-bundled version
See original GitHub issueI 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:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sgaseretto you are opening page from file-system, that’s why
//
in the url is treated asfile:///
. To fix the issue addhttp://
to script urls:and same for other scripts
I have updated the example /example/index.html@master
@sgaseretto If you just want to use it locally, try our demo: https://apis.guru/graphql-voyager/ You can select “Custom introspection” like here: