UNPKG

@graphql-mesh/transport-sqlite

Version:
18 lines (17 loc) 764 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const transport_common_1 = require("@graphql-mesh/transport-common"); const sqlite_1 = require("@omnigraph/sqlite"); const promise_helpers_1 = require("@whatwg-node/promise-helpers"); exports.default = { getSubgraphExecutor({ cwd, transportEntry }) { const loaderOpts = { cwd }; if (transportEntry.options.type === 'infile') { loaderOpts.infile = transportEntry.location; } else { loaderOpts.db = transportEntry.location; } return (0, promise_helpers_1.handleMaybePromise)(() => (0, sqlite_1.loadGraphQLSchemaFromOptions)(loaderOpts), schema => (0, transport_common_1.createDefaultExecutor)(schema)); }, };