UNPKG

@gql2ts/from-schema

Version:

convert a graphql schema to typescript interfaces

19 lines (18 loc) 958 B
import { PossibleSchemaInput } from '@gql2ts/util'; import { IFromQueryOptions, ITypeMap } from '@gql2ts/types'; export declare type SchemaToInterfaces = (schema: PossibleSchemaInput, options?: Partial<ISchemaToInterfaceOptions>, formatters?: Partial<IFromQueryOptions>) => string; export declare const schemaToInterfaces: SchemaToInterfaces; export declare type GenerateNamespace = (namespace: string, schema: PossibleSchemaInput, options?: Partial<ISchemaToInterfaceOptions>, overrides?: Partial<IFromQueryOptions>) => string; export declare const generateNamespace: GenerateNamespace; export interface ISchemaToInterfaceOptions { ignoredTypes: string[]; ignoreTypeNameDeclaration?: boolean; namespace: string; outputFile?: string; externalOptions?: string; typeMap?: ITypeMap; excludeDeprecatedFields?: boolean; } export interface IInternalOptions extends Partial<ISchemaToInterfaceOptions> { formats: IFromQueryOptions; }