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;

30 lines (29 loc) 1.54 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSubgraphExecutor = exports.processDirectives = void 0; exports.loadJSONSchemaSubgraph = loadJSONSchemaSubgraph; const tslib_1 = require("tslib"); const transport_rest_1 = tslib_1.__importDefault(require("@graphql-mesh/transport-rest")); const loadGraphQLSchemaFromJSONSchemas_js_1 = require("./loadGraphQLSchemaFromJSONSchemas.js"); exports.default = loadGraphQLSchemaFromJSONSchemas_js_1.loadGraphQLSchemaFromJSONSchemas; tslib_1.__exportStar(require("./loadGraphQLSchemaFromJSONSchemas.js"), exports); tslib_1.__exportStar(require("./getComposerFromJSONSchema.js"), exports); tslib_1.__exportStar(require("./getDereferencedJSONSchemaFromOperations.js"), exports); tslib_1.__exportStar(require("./getGraphQLSchemaFromDereferencedJSONSchema.js"), exports); function loadJSONSchemaSubgraph(name, options) { return (ctx) => ({ name, schema$: (0, loadGraphQLSchemaFromJSONSchemas_js_1.loadNonExecutableGraphQLSchemaFromJSONSchemas)(name, { ...options, fetch: ctx.fetch, cwd: ctx.cwd, logger: ctx.logger, }), }); } var transport_rest_2 = require("@graphql-mesh/transport-rest"); Object.defineProperty(exports, "processDirectives", { enumerable: true, get: function () { return transport_rest_2.processDirectives; } }); const getSubgraphExecutor = opts => { return transport_rest_1.default.getSubgraphExecutor(opts); }; exports.getSubgraphExecutor = getSubgraphExecutor;