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;

17 lines (16 loc) 952 B
import { AnyTypeComposer, ComposeInputType, ObjectTypeComposer, SchemaComposer, UnionTypeComposer } from 'graphql-compose'; import { Logger } from '@graphql-mesh/types'; import { JSONSchemaObject } from '@json-schema-tools/meta-schema'; import { TypeComposers } from './getComposerFromJSONSchema.js'; export interface GetUnionTypeComposersOpts { subgraphName: string; schemaComposer: SchemaComposer; typeComposersList: { input?: AnyTypeComposer<any>; output?: ObjectTypeComposer | UnionTypeComposer; }[]; subSchemaAndTypeComposers: JSONSchemaObject & TypeComposers; logger: Logger; } export declare function getContainerTC(subgraphName: string, schemaComposer: SchemaComposer, output: ComposeInputType): ObjectTypeComposer<any, any>; export declare function getUnionTypeComposers({ subgraphName, schemaComposer, typeComposersList, subSchemaAndTypeComposers, logger, }: GetUnionTypeComposersOpts): TypeComposers;