@aws-amplify/graphql-types-generator
Version:
Generate API code or type annotations based on a GraphQL schema and statements
34 lines (33 loc) • 1.32 kB
TypeScript
import { GraphQLEnumType, GraphQLInputObjectType } from 'graphql';
import { CompilerContext, Operation, Fragment } from '../compiler';
import { BasicGeneratedFile } from '../utilities/CodeGenerator';
import { FlowGenerator } from './language';
import { Printer } from './printer';
declare class FlowGeneratedFile implements BasicGeneratedFile {
fileContents: string;
constructor(fileContents: string);
get output(): string;
}
export declare function generateSource(context: CompilerContext): {
[filePath: string]: FlowGeneratedFile;
};
export declare class FlowAPIGenerator extends FlowGenerator {
context: CompilerContext;
printer: Printer;
scopeStack: string[];
constructor(context: CompilerContext);
fileHeader(): void;
typeAliasForEnumType(enumType: GraphQLEnumType): void;
typeAliasForInputObjectType(inputObjectType: GraphQLInputObjectType): void;
typeAliasesForOperation(operation: Operation): void;
typeAliasesForFragment(fragment: Fragment): void;
private getVariantsForSelectionSet;
private getTypeCasesForSelectionSet;
private getPropertiesForVariant;
private handleFieldSelectionSetValue;
private handleFieldValue;
get output(): string;
scopeStackPush(name: string): void;
scopeStackPop(): string | undefined;
}
export {};