0.10.1 • Published 4 months ago

@graphql-ez/plugin-voyager v0.10.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@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',
});
0.10.1

4 months ago

0.10.0

1 year ago

0.9.5

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago