Registry / devops / graphql-voyager

graphql-voyager

JSON →
library2.1.0jsnpmunverified

Interactive visual graph explorer for any GraphQL API. Current stable version is 2.1.0, supporting GraphQL >=16.5.0 and React >=18.0.0. Features include interactive graph visualization, type documentation panel, Relay skip option, and custom root type selection. Released as middleware for Express, Hapi, Koa, and Fastify, or as a standalone React component. Differentiated from alternatives like GraphiQL by focusing on visual schema exploration rather than query building.

npm install graphql-voyager
INSTALL
IMPORT
SIG · GRAPHQL-VOYAGER
G
graphql-voyager
devopsjavascriptv2.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Voyager
import { Voyager } from 'graphql-voyager'
const Voyager = require('graphql-voyager')
ESM-only since v2. Voyager is a React component.
express middleware
import { express as voyagerMiddleware } from 'graphql-voyager/middleware'
import voyagerMiddleware from 'graphql-voyager/middleware'
Named export, not default. Works with Express only.
init
import { init } from 'graphql-voyager'
import init from 'graphql-voyager'
init is a named export for standalone usage.

Basic React integration: import component, CSS, and pass introspection function.

import React from 'react'; import { Voyager } from 'graphql-voyager'; import 'graphql-voyager/dist/voyager.css'; function App() { return ( <Voyager introspection={fetch('https://api.example.com/graphql', { headers: { Authorization: process.env.AUTH_TOKEN ?? '' } }).then(res => res.json())} displayOptions={{ skipRelay: true, sortByAlphabet: true }} /> ); }
Debug
Known issues
breakingESM-only in v2; CommonJS require() will fail.
fix
Use import syntax or dynamic import().
affects: >=2.0.0
deprecatedVoyager component properties like 'introspection' as function deprecated in v2.1? (Check docs).
fix
Pass introspection as object or Promise-returning function.
affects: >=2.0.0
gotchaPeer dependencies graphql >=16.5.0 and react >=18.0.0 are required but not auto-installed.
fix
Install manually: npm install graphql react.
affects: >=2.0.0
deprecatedThe 'init' helper from standalone UMD bundle is not directly importable in ESM; use Voyager component instead.
fix
Use Voyager component for React apps.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'graphql-voyager/middleware'
Missing import path or incorrect middleware name.
fix
Use: import { express as voyagerMiddleware } from 'graphql-voyager/middleware'
export 'Voyager' (imported as 'Voyager') was not found in 'graphql-voyager'
Using CommonJS require() with ESM-only package.
fix
Change to import statement: import { Voyager } from 'graphql-voyager'
Uncaught TypeError: introspection is not a function
Passing string instead of function or object.
fix
Ensure introspection prop is a function that returns a promise, or an object.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies
graphqlrequiredpeer dependency for introspection
reactrequiredpeer dependency for UI rendering
Agent activity
6 hits · last 30 days
node
6
Resources
graphql-voyager — npm install graphql-voyager · libregistry