Gathering detailed insights and metrics for @prisma-cms/graphql-voyager
Gathering detailed insights and metrics for @prisma-cms/graphql-voyager
Gathering detailed insights and metrics for @prisma-cms/graphql-voyager
Gathering detailed insights and metrics for @prisma-cms/graphql-voyager
🛰️ Represent any GraphQL API as an interactive graph
npm install @prisma-cms/graphql-voyager
Typescript
Module System
Node Version
NPM Version
TypeScript (69.55%)
JavaScript (14.88%)
CSS (12.72%)
HTML (2.85%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
447 Commits
1 Watchers
7 Branches
1 Contributors
Updated on Nov 25, 2018
Latest Version
1.1.2
Package Id
@prisma-cms/graphql-voyager@1.1.2
Unpacked Size
2.67 MB
Size
752.53 kB
File Count
75
NPM Version
5.8.0
Node Version
10.15.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
12
41
Represent any GraphQL API as an interactive graph. It's time to finally see the graph behind GraphQL. You can also explore number of public GraphQL APIs from our list.
With graphql-voyager you can visually explore your GraphQL API as an interactive graph. This is a great tool when designing or discussing your data model. It includes multiple example GraphQL schemas and also allows you to connect it to your own GraphQL endpoint. What are you waiting for, explore your API!
GraphQL Voyager exports Voyager
React component and helper init
function. If used without
module system it is exported as GraphQLVoyager
global variable.
Voyager
component accepts the following properties:
introspection
[object
or function: (query: string) => Promise
] - the server introspection response. If function
is provided GraphQL Voyager will pass introspection query as a first function parameter. Function should return Promise
which resolves to introspection response object.displayOptions
(optional)
displayOptions.skipRelay
[boolean
, default true
] - skip relay-related entitiesdisplayOptions.skipDeprecated
[boolean
, default true
] - skip deprecated fields and entities that contain only deprecated fields.displayOptions.rootType
[string
] - name of the type to be used as a rootdisplayOptions.sortByAlphabet
[boolean
, default false
] - sort fields on graph by alphabetdisplayOptions.showLeafFields
[boolean
, default true
] - show all scalars and enumsdisplayOptions.hideRoot
[boolean
, default false
] - hide the root typehideDocs
[boolean
, default false
] - hide the docs sidebarhideSettings
[boolean
, default false
] - hide settings panelworkerURI
[string
] (optional) - absolute or relative path to Voyager web worker. By default it will try to load it from voyager.worker.js
.loadWorker
[function: (path: string, relative: boolean) => Promise<Worker>
] (optional) - If provided GraphQL Voyager will use this function to load the worker. By default it will use the internal callback in utils/index.ts
init
functionThe signature of the init
function:
1(hostElement: HTMLElement, options: object) => void
hostElement
- parent elementoptions
- is the JS object with properties of Voyager
componentYou can get GraphQL Voyager bundle from the following places:
dist
folder of the npm package graphql-voyager
Important: for the latest two options make sure to copy voyager.worker.js
to the same
folder as voyager.min.js
.
The HTML with minimal setup (see the full example)
1<!DOCTYPE html> 2<html> 3 <head> 4 <script src="https://cdn.jsdelivr.net/npm/react@16/umd/react.production.min.js"></script> 5 <script src="https://cdn.jsdelivr.net/npm/react-dom@16/umd/react-dom.production.min.js"></script> 6 7 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/graphql-voyager/dist/voyager.css" /> 8 <script src="https://cdn.jsdelivr.net/npm/graphql-voyager/dist/voyager.min.js"></script> 9 </head> 10 <body> 11 <div id="voyager">Loading...</div> 12 <script> 13 function introspectionProvider(introspectionQuery) { 14 // ... do a call to server using introspectionQuery provided 15 // or just return pre-fetched introspection 16 } 17 18 // Render <Voyager /> 19 GraphQLVoyager.init(document.getElementById('voyager'), { 20 introspection: introspectionProvider 21 }) 22 </script> 23 </body> 24</html>
You can install lib using npm
or yarn
:
npm i --save graphql-voyager
yarn add graphql-voyager
And then use it:
1import * as React from 'react'; 2import * as ReactDOM from 'react-dom'; 3import {Voyager} from 'graphql-voyager'; 4import fetch from 'isomorphic-fetch'; 5 6function introspectionProvider(query) { 7 return fetch(window.location.origin + '/graphql', { 8 method: 'post', 9 headers: { 'Content-Type': 'application/json' }, 10 body: JSON.stringify({query: query}), 11 }).then(response => response.json()); 12} 13 14ReactDOM.render(<Voyager introspection={introspectionProvider} />, document.getElementById('voyager'));
Build for the web with webpack (example) or browserify
Important: make sure to copy voyager.worker.js
from node_modules/graphql-voyager/dist
to the same folder as your main bundle or use workerURI
property to specify other path.
NOTE if you use it with create-react-app
, copy worker file to public
folder and use workerURI
property like this:
1 <Voyager 2 // ... 3 workerURI={process.env.PUBLIC_URL + '/voyager.worker.js'} 4 // ... 5 />
Graphql Voyager has middleware for the next frameworks:
Middleware supports the following properties:
endpointUrl
[string
] - the GraphQL endpoint url.displayOptions
[object
] - same as hereheadersJS
[string
, default "{}"
] - object of headers serialized in string to be used on endpoint url{ Authorization: localStorage['Meteor.loginToken'] }
1import express from 'express'; 2import { express as voyagerMiddleware } from 'graphql-voyager/middleware'; 3 4const app = express(); 5 6app.use('/voyager', voyagerMiddleware({ endpointUrl: '/graphql' })); 7 8app.listen(3001);
1import hapi from 'hapi'; 2import { hapi as voyagerMiddleware } from 'graphql-voyager/middleware'; 3 4const server = new Hapi.Server({ 5 port: 3001 6}); 7 8const init = async () => { 9 await server.register({ 10 plugin: voyagerMiddleware, 11 options: { 12 path: '/voyager', 13 endpointUrl: '/graphql' 14 } 15 }); 16 17 await server.start(); 18}; 19 20init();
1import hapi from 'hapi'; 2import { hapiLegacy as voyagerMiddleware } from 'graphql-voyager/middleware'; 3 4const server = new Hapi.Server(); 5 6server.connection({ 7 port: 3001 8}); 9 10server.register({ 11 register: voyagerMiddleware, 12 options: { 13 path: '/voyager', 14 endpointUrl: '/graphql' 15 } 16},() => server.start());
1import Koa from 'koa'; 2import KoaRouter from 'koa-router'; 3import { koa as voyagerMiddleware } from 'graphql-voyager/middleware'; 4 5const app = new Koa(); 6const router = new KoaRouter(); 7 8router.all('/voyager', voyagerMiddleware({ 9 endpointUrl: '/graphql' 10})); 11 12app.use(router.routes()); 13app.use(router.allowedMethods()); 14app.listen(3001);
This tool is inspired by graphql-visualizer project.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More