
yarn add @graphql-ez/plugin-voyagerpnpm add @graphql-ez/plugin-voyagernpm install @graphql-ez/plugin-voyagerIntegration with GraphQL Voyager
import { ezVoyager } from '@graphql-ez/plugin-voyager';
const ezApp = CreateApp({
  ez: {
    plugins: [
      ezVoyager({
        // 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;
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',
});
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',
});
@graphql-ez/plugin-voyagerMIT0.9.4May 18th, 2022