UNPKG

@graphql-codegen/client-preset

Version:
57 lines (56 loc) 1.79 kB
import type { Types } from '@graphql-codegen/plugin-helpers'; import babelOptimizerPlugin from './babel.cjs'; export declare type FragmentMaskingConfig = { /** @description Name of the function that should be used for unmasking a masked fragment property. * @default `'useFragment'` */ unmaskFunctionName?: string; }; export declare type ClientPresetConfig = { /** * @description Fragment masking hides data from components and only allows accessing the data by using a unmasking function. * @exampleMarkdown * ```tsx * const config = { * schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', * documents: ['src/**\/*.tsx', '!src\/gql/**\/*'], * generates: { * './src/gql/': { * preset: 'client', * presetConfig: { * fragmentMasking: false, * } * }, * }, * }; * export default config; * ``` */ fragmentMasking?: FragmentMaskingConfig | boolean; /** * @description Specify the name of the "graphql tag" function to use * @default "graphql" * * E.g. `graphql` or `gql`. * * @exampleMarkdown * ```tsx * const config = { * schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', * documents: ['src/**\/*.tsx', '!src\/gql/**\/*'], * generates: { * './src/gql/': { * preset: 'client', * presetConfig: { * gqlTagName: 'gql', * } * }, * }, * }; * export default config; * ``` */ gqlTagName?: string; }; export declare const preset: Types.OutputPreset<ClientPresetConfig>; export { babelOptimizerPlugin };