graphql-2-json-schema
Version:
`graphql-2-json-schema` package
17 lines (16 loc) • 1.05 kB
TypeScript
import { IntrospectionField, IntrospectionInputValue, IntrospectionType } from 'graphql';
import { JSONSchema6 } from 'json-schema';
import { MemoListIterator } from 'lodash';
export declare type JSONSchema6Acc = {
[k: string]: JSONSchema6;
};
declare type ReducerOptions = {
nullableArrayItems?: boolean;
};
declare type GetRequiredFieldsType = ReadonlyArray<IntrospectionInputValue | IntrospectionField>;
export declare const getRequiredFields: (fields: GetRequiredFieldsType) => string[];
export declare type IntrospectionFieldReducerItem = IntrospectionField | IntrospectionInputValue;
export declare const introspectionFieldReducerGenerator: (options: ReducerOptions) => MemoListIterator<IntrospectionFieldReducerItem, JSONSchema6Acc, ReadonlyArray<IntrospectionFieldReducerItem>>;
export declare const resolveDefaultValue: (curr: any) => any;
export declare const introspectionTypeReducer: (type: 'definitions' | 'properties', options: ReducerOptions) => MemoListIterator<IntrospectionType, JSONSchema6Acc, IntrospectionType[]>;
export {};