UNPKG

@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;

14 lines (13 loc) 505 B
import { AnyTypeComposer, SchemaComposer } from 'graphql-compose'; import { Logger } from '@graphql-mesh/types'; import { JSONSchema } from 'json-machete'; export interface TypeComposers { input?: AnyTypeComposer<any>; output: AnyTypeComposer<any> | SchemaComposer; description?: string; nullable?: boolean; default?: any; readOnly?: boolean; writeOnly?: boolean; } export declare function getComposerFromJSONSchema(schema: JSONSchema, logger: Logger): Promise<TypeComposers>;