Voltar ao ranking

graphql-kit/graphql-voyager

TypeScriptgraphql-kit.com/graphql-voyager/

🛰️ Represent any GraphQL API as an interactive graph

graphqlapi-documentationvisualizationgraphvizgraphql-tools
Crescimento de estrelas
Estrelas
7.9k
Forks
522
Crescimento semanal
Issues
86
2k4k6k
mai. de 23ago. de 23dez. de 23mai. de 24
Artefatosnpmnpm install graphql-voyager
README

GraphQL Voyager

graphql-voyager logo

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 Weekly #42

Live Demo

voyager demo

Features

  • Quick navigation on graph
  • Left panel which provides more detailed information about every type
  • "Skip Relay" option that simplifies graph by removing Relay wrapper classes
  • Ability to choose any type to be a root of the graph

API

GraphQL Voyager exports Voyager React component and helper init function. If used without module system it is exported as GraphQLVoyager global variable.

Properties

Voyager component accepts the following properties:

  • introspection [object] - 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 entities
    • displayOptions.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 root
    • displayOptions.sortByAlphabet [boolean, default false] - sort fields on graph by alphabet
    • displayOptions.showLeafFields [boolean, default true] - show all scalars and enums
    • displayOptions.hideRoot [boolean, default false] - hide the root type
  • allowToChangeSchema [boolean, default false] - allow users to change schema
  • hideDocs [boolean, default false] - hide the docs sidebar
  • hideSettings [boolean, default false] - hide settings panel
  • hideVoyagerLogo [boolean, default true] - hide voyager logo

Using pre-bundled version

You can get GraphQL Voyager bundle from the following places:

Note: voyager.standalone.js is bundled with react, so you just need to call renderVoyager function that's it.

HTML example

Using as a dependency

Build for the web with webpack, or any other bundle.

Webpack example

Middleware

GraphQL Voyager has middleware for the next frameworks:

Properties

Middleware supports the following properties:

  • endpointUrl [string] - the GraphQL endpoint url.
  • displayOptions [object] - same as here
  • headersJS [string, default "{}"] - object of headers serialized in string to be used on endpoint url
    Note: You can also use any JS expression which results in an object with header names as keys and strings as values e.g. { Authorization: localStorage['Meteor.loginToken'] }

Express

import express from 'express';
import { express as voyagerMiddleware } from 'graphql-voyager/middleware';

const app = express();

app.use('/voyager', voyagerMiddleware({ endpointUrl: '/graphql' }));

app.listen(3001);

Hapi

Version 20+

import Hapi from '@hapi/hapi';
import { hapi as voyagerMiddleware } from 'graphql-voyager/middleware';

const server = new Hapi.Server({
  port: 3001,
});

const init = async () => {
  await server.register({
    plugin: voyagerMiddleware,
    options: {
      path: '/voyager',
      endpointUrl: '/graphql',
    },
  });

  await server.start();
};

init();

Koa

import Koa from 'koa';
import KoaRouter from 'koa-router';
import { koa as voyagerMiddleware } from 'graphql-voyager/middleware';

const app = new Koa();
const router = new KoaRouter();

router.all(
  '/voyager',
  voyagerMiddleware({
    endpointUrl: '/graphql',
  }),
);

app.use(router.routes());
app.use(router.allowedMethods());
app.listen(3001);

Credits

This tool is inspired by graphql-visualizer project.

Repositórios relacionados
hoppscotch/hoppscotch

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

TypeScriptnpmMIT Licenseapiapi-client
hoppscotch.io
79.8k6k
strapi/strapi

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable, and developer-first.

TypeScriptnpmOtherstrapinodejs
strapi.io
72.7k9.8k
gatsbyjs/gatsby

React-based framework with performance, scalability, and security built in.

JavaScriptnpmMIT Licensegatsbystatic-site-generator
gatsbyjs.com
56k10.2k
twentyhq/twenty

The open alternative to Salesforce, designed for AI.

TypeScriptnpmOthercrmcustomer
twenty.com
53.4k8.1k
prettier/prettier

Prettier is an opinionated code formatter.

JavaScriptnpmMIT Licenseformatterprinter
prettier.io
52.1k4.9k
TanStack/query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.

TypeScriptnpmMIT Licensereacthooks
tanstack.com/query
50k4k
payloadcms/payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.

TypeScriptnpmMIT Licenseheadless-cmscms
payloadcms.com
43.7k4k
Kong/insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.

TypeScriptnpmApache License 2.0electron-apprest-api
insomnia.rest
39.9k2.4k
directus/directus

The flexible backend for all your projects 🐰 Turn your DB into a headless CMS, admin panels, or apps with a custom UI, instant APIs, auth & more.

TypeScriptnpmOtherapicms
directus.com
36.7k4.9k
refinedev/refine

A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.

TypeScriptnpmMIT Licensereacttypescript
refine.dev
35.4k3.2k
hasura/graphql-engine

Blazing fast, instant realtime GraphQL APIs on all your data with fine grained access control, also trigger webhooks on database events.

TypeScriptnpmApache License 2.0graphqlgraphql-server
hasura.io
32k2.9k
slymnoyann/hey-1

Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

TypeScriptnpmGNU General Public License v3.0web3blockchain
hey.xyz
29.4k1.8k