@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;
26 lines (25 loc) • 1.49 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.processDirectives = exports.getSubgraphExecutor = exports.loadJSONSchemaSubgraph = void 0;
const tslib_1 = require("tslib");
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);
tslib_1.__exportStar(require("./types.js"), exports);
function loadJSONSchemaSubgraph(name, options) {
return (ctx) => ({
name,
schema$: (0, loadGraphQLSchemaFromJSONSchemas_js_1.loadNonExecutableGraphQLSchemaFromJSONSchemas)(name, {
...options,
fetch: ctx.fetch,
cwd: ctx.cwd,
}),
});
}
exports.loadJSONSchemaSubgraph = loadJSONSchemaSubgraph;
var transport_rest_1 = require("@graphql-mesh/transport-rest");
Object.defineProperty(exports, "getSubgraphExecutor", { enumerable: true, get: function () { return transport_rest_1.getSubgraphExecutor; } });
Object.defineProperty(exports, "processDirectives", { enumerable: true, get: function () { return transport_rest_1.processDirectives; } });
;