@omnigraph/json-schema
Version:
This package generates GraphQL Schema from JSON Schema and sample JSON request and responses. You can define your root field endpoints like below in your GraphQL Config for example;
7 lines (6 loc) • 524 B
TypeScript
import { GraphQLTypeResolver } from 'graphql';
import { ObjectTypeComposer, UnionTypeComposer } from 'graphql-compose';
import Ajv from 'ajv';
import { JSONSchemaObject } from 'json-machete';
import { TypeComposers } from './getComposerFromJSONSchema';
export declare function getTypeResolverFromOutputTCs(ajv: Ajv, outputTypeComposers: (ObjectTypeComposer | UnionTypeComposer)[], subSchemaAndTypeComposers: JSONSchemaObject & TypeComposers, statusCodeOneOfIndexMap?: Record<string, number>): GraphQLTypeResolver<any, any>;