1 | "use strict";
|
2 | var __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 | };
|
13 | Object.defineProperty(exports, "__esModule", { value: true });
|
14 | var apollo_server_core_1 = require("apollo-server-core");
|
15 | var gql_1 = require("./gql");
|
16 | function 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 | }
|
25 | exports.runQueryLodash = runQueryLodash;
|
26 |
|
\ | No newline at end of file |