UNPKG

998 BJavaScriptView Raw
1"use strict";
2var __assign = (this && this.__assign) || function () {
3 __assign = Object.assign || function(t) {
4 for (var s, i = 1, n = arguments.length; i < n; i++) {
5 s = arguments[i];
6 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7 t[p] = s[p];
8 }
9 return t;
10 };
11 return __assign.apply(this, arguments);
12};
13Object.defineProperty(exports, "__esModule", { value: true });
14var apollo_server_core_1 = require("apollo-server-core");
15var gql_1 = require("./gql");
16function runQueryLodash(options) {
17 var _a = gql_1.graphqlLodash(options.query), transform = _a.transform, apply = _a.apply;
18 if (apply) {
19 return apollo_server_core_1.runQuery(options).then(function (result) { return (__assign({}, result, { data: transform(result.data) })); });
20 }
21 else {
22 return apollo_server_core_1.runQuery(options);
23 }
24}
25exports.runQueryLodash = runQueryLodash;
26//# sourceMappingURL=runQuery.js.map
\No newline at end of file