Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
graphql-voyager
Advanced tools
Readme
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
] - 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 typeallowToChangeSchema
[boolean
, default false
] - allow users to change schemahideDocs
[boolean
, default false
] - hide the docs sidebarhideSettings
[boolean
, default false
] - hide settings panelhideVoyagerLogo
[boolean
, default true
] - hide voyager logoYou can get GraphQL Voyager bundle from the following places:
dist
folder of the npm package graphql-voyager
Note: voyager.standalone.js
is bundled with react, so you just need to call
renderVoyager
function that's it.
Build for the web with webpack, or any other bundle.
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'] }
import express from 'express';
import { express as voyagerMiddleware } from 'graphql-voyager/middleware';
const app = express();
app.use('/voyager', voyagerMiddleware({ endpointUrl: '/graphql' }));
app.listen(3001);
import hapi from '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();
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);
This tool is inspired by graphql-visualizer project.
FAQs
GraphQL introspection viewer
The npm package graphql-voyager receives a total of 23,557 weekly downloads. As such, graphql-voyager popularity was classified as popular.
We found that graphql-voyager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.