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;

22 lines (21 loc) 1.09 kB
import type { TransportGetSubgraphExecutor } from '@graphql-mesh/transport-common'; import { type RESTTransportOptions } from '@graphql-mesh/transport-rest'; import type { Logger, MeshFetch } from '@graphql-mesh/types'; import { loadGraphQLSchemaFromJSONSchemas } from './loadGraphQLSchemaFromJSONSchemas.js'; import type { JSONSchemaLoaderOptions } from './types.js'; export default loadGraphQLSchemaFromJSONSchemas; export * from './loadGraphQLSchemaFromJSONSchemas.js'; export * from './getComposerFromJSONSchema.js'; export * from './getDereferencedJSONSchemaFromOperations.js'; export * from './getGraphQLSchemaFromDereferencedJSONSchema.js'; export type * from './types.js'; export declare function loadJSONSchemaSubgraph(name: string, options: JSONSchemaLoaderOptions): (ctx: { fetch: MeshFetch; cwd: string; logger: Logger; }) => { name: string; schema$: Promise<import("graphql").GraphQLSchema>; }; export { processDirectives } from '@graphql-mesh/transport-rest'; export declare const getSubgraphExecutor: TransportGetSubgraphExecutor<RESTTransportOptions>;