Docs

GraphQL EZ

Get Started

Plugin Hub > GraphQL Voyager

npm version
yarn add @graphql-ez/plugin-voyager

@graphql-ez/plugin-voyager#

Integration with GraphQL Voyager

Usage#

import { ezVoyager } from '@graphql-ez/plugin-voyager'; const ezApp = CreateApp({ ez: { plugins: [ ezVoyager({ // Options }), // ... ], }, // ... });

Options#

Most of these types come from GraphQL Voyager properties

type VoyagerPluginOptions = | { /** * @default "/voyager" */ path?: string; /** * Manually transform the rendered HTML */ transformHtml?: (html: string) => string; endpoint?: string; headers?: string | Record<string, unknown>; displayOptions?: { rootType?: string; skipRelay?: boolean; skipDeprecated?: boolean; showLeafFields?: boolean; sortByAlphabet?: boolean; hideRoot?: boolean; }; credentials?: 'same-origin' | 'include' | 'omit'; } | boolean;

Next.js Usage#

In Next.js you need to use this plugin's handler explicitly in your API routes, for example, following the file structure: /pages/api/voyager.ts, and using this snippet:

// /pages/api/voyager.ts import { VoyagerHandler } from '@graphql-ez/plugin-voyager'; export default VoyagerHandler({ endpointUrl: '/api/graphql', });

Vercel Usage#

For Vercel you need to use this plugin's handler explicitly in your API routes, for example, following the file structure: /api/voyager.ts, and using this snippet:

// /api/voyager.ts import { VoyagerHandler } from '@graphql-ez/plugin-voyager'; export default VoyagerHandler({ endpointUrl: '/api/graphql', });

Plugin Details

Identifier
@graphql-ez/plugin-voyager
License
MIT
Version
0.10.0
Updated
Dec 18th, 2022