megaera
Version:
GraphQL to TypeScript Generator
23 lines (22 loc) • 671 B
TypeScript
import { GraphQLOutputType, GraphQLType } from 'graphql/type/definition.js';
import { Source } from 'graphql/language/index.js';
import { GraphQLSchema } from 'graphql/type/index.js';
export type Variable = {
name: string;
type: GraphQLType | undefined;
required: boolean;
};
export type Selector = {
name: string;
type?: GraphQLOutputType;
fields: Selector[];
inlineFragments: Selector[];
variables?: Variable[];
isFragment?: boolean;
source?: string;
};
export type Content = {
operations: Selector[];
fragments: Map<string, Selector>;
};
export declare function traverse(schema: GraphQLSchema, source: Source): Content;