@gqty/cli
Version:
Interactive codegen for GQty
42 lines (41 loc) • 1.31 kB
TypeScript
import type { GenerateOptions } from './generate';
import type { IntrospectionOptions } from './introspection';
export type GQtyConfig = GenerateOptions & {
/**
* Introspection options
*
* @deprecated Use `introspections` instead
*/
introspection?: IntrospectionOptions;
/**
* Introspection options for multple endpoints.
*
* ```json
* {
* "https://example.com/graphql": {
* "headers": {
* "Authorization": "Bearer ..."
* }
* }
* }
* ```
*/
introspections?: Record<string, Pick<RequestInit, 'headers'>>;
/**
* Client generation destination
*/
destination?: string;
};
export declare const DUMMY_ENDPOINT = "SPECIFY_ENDPOINT_OR_SCHEMA_FILE_PATH_HERE";
export type SetRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
export declare const defaultConfig: SetRequired<GQtyConfig, Exclude<keyof GQtyConfig, 'react' | 'introspections' | 'transformSchema'>>;
export declare function getValidConfig(v: unknown): GQtyConfig;
type GQtyConfigResult = {
config: GQtyConfig;
filepath: string;
isEmpty?: boolean;
};
export declare const loadOrGenerateConfig: ({ writeConfigFile, }?: {
writeConfigFile?: boolean;
}) => Promise<GQtyConfigResult>;
export {};