@omnigraph/thrift
Version: 
34 lines (33 loc) • 1.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSubgraphExecutor = exports.loadThriftSubgraph = void 0;
const tslib_1 = require("tslib");
const execution_js_1 = require("./execution.js");
const schema_js_1 = require("./schema.js");
async function loadGraphQLSchemaFromThriftIDL(name, opts) {
    return (0, schema_js_1.loadNonExecutableGraphQLSchemaFromIDL)({
        ...opts,
        subgraphName: name,
    });
}
exports.default = loadGraphQLSchemaFromThriftIDL;
tslib_1.__exportStar(require("./types.js"), exports);
tslib_1.__exportStar(require("./schema.js"), exports);
tslib_1.__exportStar(require("./execution.js"), exports);
tslib_1.__exportStar(require("./client.js"), exports);
function loadThriftSubgraph(name, options) {
    return ({ cwd, fetch }) => ({
        name,
        schema$: (0, schema_js_1.loadNonExecutableGraphQLSchemaFromIDL)({
            fetchFn: fetch,
            baseDir: cwd,
            subgraphName: name,
            ...options,
        }),
    });
}
exports.loadThriftSubgraph = loadThriftSubgraph;
function getSubgraphExecutor(transportContext) {
    return (0, execution_js_1.getThriftExecutor)(transportContext.getSubgraph());
}
exports.getSubgraphExecutor = getSubgraphExecutor;