graphql-2-json-schema
Version:
`graphql-2-json-schema` package
14 lines (13 loc) • 886 B
TypeScript
import { IntrospectionInputTypeRef, IntrospectionOutputTypeRef, IntrospectionTypeRef } from 'graphql';
import { JSONSchema6, JSONSchema6TypeName } from 'json-schema';
import { GraphQLTypeNames, IDTypeMapping as IDTypeMappingType } from './types';
export declare const ID_TYPE_MAPPING_OPTION_DEFAULT: IDTypeMappingType;
export declare const scalarToJsonType: (scalarName: GraphQLTypeNames, options?: GraphqlToJSONTypeOptions) => JSONSchema6TypeName | JSONSchema6TypeName[];
export declare type GraphqlToJSONTypeArg = IntrospectionTypeRef | IntrospectionInputTypeRef | IntrospectionOutputTypeRef;
export declare type GraphqlToJSONTypeOptions = {
nullableArrayItems?: boolean;
isArray?: boolean;
isNonNull?: boolean;
idTypeMapping?: IDTypeMappingType;
};
export declare const graphqlToJSONType: (k: GraphqlToJSONTypeArg, options?: GraphqlToJSONTypeOptions) => JSONSchema6;