@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;
19 lines (18 loc) • 798 B
JavaScript
import { loadGraphQLSchemaFromJSONSchemas, loadNonExecutableGraphQLSchemaFromJSONSchemas, } from './loadGraphQLSchemaFromJSONSchemas.js';
export default loadGraphQLSchemaFromJSONSchemas;
export * from './loadGraphQLSchemaFromJSONSchemas.js';
export * from './getComposerFromJSONSchema.js';
export * from './getDereferencedJSONSchemaFromOperations.js';
export * from './getGraphQLSchemaFromDereferencedJSONSchema.js';
export * from './types.js';
export function loadJSONSchemaSubgraph(name, options) {
return (ctx) => ({
name,
schema$: loadNonExecutableGraphQLSchemaFromJSONSchemas(name, {
...options,
fetch: ctx.fetch,
cwd: ctx.cwd,
}),
});
}
export { getSubgraphExecutor, processDirectives } from '@graphql-mesh/transport-rest';