UNPKG

@magidoc/rollup-plugin-gql-schema

Version:

A Rollup and ViteJS plugin that allows to parse a GraphQL Schema from a target URL and save it to a target output folder, or to parse it from the disk and convert it to a desired format.

23 lines (22 loc) 720 B
import type { Plugin } from 'rollup'; import { type OutputFormat } from '../schema/convert'; export type PluginOptions = { /** * The paths to the GraphQL SDL files. Glob syntax may be used. */ paths: string[]; /** * Indicates the target path for the JSON Schema resulting from the Query. * * @default src/_schema.json */ target?: string; /** * Wether the output format should be a GraphQL SDL file or an introspection JSON file. * * Defaults to introspection JSON. */ format?: OutputFormat; }; export declare function parseSchema(options: PluginOptions): Promise<void>; export default function parseGraphQLSchema(options: PluginOptions): Plugin;