1 | "use strict";
|
2 | var __rest = (this && this.__rest) || function (s, e) {
|
3 | var t = {};
|
4 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
5 | t[p] = s[p];
|
6 | if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
7 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
8 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
9 | t[p[i]] = s[p[i]];
|
10 | }
|
11 | return t;
|
12 | };
|
13 | Object.defineProperty(exports, "__esModule", { value: true });
|
14 | exports.CustomField = void 0;
|
15 | var type_graphql_1 = require("type-graphql");
|
16 | var typeorm_1 = require("typeorm");
|
17 | var schema_1 = require("../schema");
|
18 | var utils_1 = require("../utils");
|
19 | var WarthogField_1 = require("./WarthogField");
|
20 | function CustomField(args) {
|
21 |
|
22 |
|
23 | var _a = args.api, type = _a.type, filter = _a.filter, sort = _a.sort, typeGraphQLOptions = __rest(_a, ["type", "filter", "sort"]);
|
24 | var warthogOptions = { nullable: args.api.nullable, type: type, filter: filter, sort: sort };
|
25 |
|
26 | var factories = [
|
27 | WarthogField_1.WarthogField(args.api.type, warthogOptions),
|
28 | type_graphql_1.Field(function () { return schema_1.columnTypeToGraphQLType(args.api.type); }, typeGraphQLOptions),
|
29 | typeorm_1.Column(args.db)
|
30 | ];
|
31 | return utils_1.composeMethodDecorators.apply(void 0, factories);
|
32 | }
|
33 | exports.CustomField = CustomField;
|
34 |
|
\ | No newline at end of file |