@gqty/cli
Version:
Interactive codegen for GQty
29 lines (28 loc) • 899 B
TypeScript
import type { GraphQLSchema } from 'graphql';
import type { GenerateOptions, TransformSchemaOptions } from './generate';
import type { OnExistingFileConflict } from './writeGenerate';
export interface UseGenerateGQtyOptions extends GenerateOptions {
/**
* Client generation destination
*/
destination?: string;
/**
* Customize the behavior when the target client file already exists, by default it does nothing
*/
onExistingFileConflict?: OnExistingFileConflict;
/**
* Custom Schema generation transformations
*/
transformsGenerate?: TransformSchemaOptions;
/**
* What to do when an error happens
*
* @default console.error
*/
onError?: (err: unknown) => void;
}
export declare function useGenerateGQty(config?: UseGenerateGQtyOptions): {
onSchemaChange(options: {
schema: GraphQLSchema;
}): void;
};