UNPKG

graphql-2-json-schema

Version:
14 lines (13 loc) 717 B
import { IntrospectionInputTypeRef, IntrospectionOutputTypeRef, IntrospectionTypeRef } from 'graphql'; import { JSONSchema6, JSONSchema6TypeName } from 'json-schema'; export declare type GraphQLTypeNames = 'String' | 'Int' | 'Float' | 'Boolean' | 'ID'; export declare const typesMapping: { [k in GraphQLTypeNames]: JSONSchema6TypeName; }; export declare type GraphqlToJSONTypeArg = IntrospectionTypeRef | IntrospectionInputTypeRef | IntrospectionOutputTypeRef; export declare type GraphqlToJSONTypeOptions = { nullableArrayItems?: boolean; isArray?: boolean; isNonNull?: boolean; }; export declare const graphqlToJSONType: (k: GraphqlToJSONTypeArg, options?: GraphqlToJSONTypeOptions) => JSONSchema6;