@snowtop/ent 0.1.0-alpha124 → 0.1.0-alpha126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gqlFileUpload = exports.gqlConnection = exports.gqlContextType = exports.gqlMutation = exports.gqlQuery = exports.gqlObjectType = exports.gqlInputObjectType = exports.gqlArgType = exports.gqlArg = exports.gqlField = exports.GQLCapture = exports.addCustomType = exports.isCustomType = exports.knownDisAllowedNames = exports.knownAllowedNames = exports.CustomFieldType = void 0;
4
- require("reflect-metadata");
5
- // export interface gqlTopLevelOptions
6
- // name?: string;
7
- // type?: Type | Array<Type>;
8
- // description?: string;
9
- // }
3
+ exports.gqlFileUpload = exports.gqlConnection = exports.gqlContextType = exports.gqlMutation = exports.gqlQuery = exports.gqlObjectType = exports.gqlInputObjectType = exports.gqlArgType = exports.gqlField = exports.GQLCapture = exports.addCustomType = exports.isCustomType = exports.knownDisAllowedNames = exports.knownAllowedNames = exports.CustomFieldType = void 0;
10
4
  var CustomFieldType;
11
5
  (function (CustomFieldType) {
12
6
  CustomFieldType["Accessor"] = "ACCESSOR";
@@ -29,6 +23,7 @@ exports.knownAllowedNames = new Map([
29
23
  ["Int", "number"],
30
24
  ["Float", "number"],
31
25
  ["ID", "ID"],
26
+ ["JSON", "any"],
32
27
  ]);
33
28
  exports.knownDisAllowedNames = new Map([
34
29
  ["Function", true],
@@ -149,7 +144,6 @@ class GQLCapture {
149
144
  this.customInputObjects.clear();
150
145
  this.customObjects.clear();
151
146
  this.customTypes.clear();
152
- this.argMap.clear();
153
147
  }
154
148
  static getCustomFields() {
155
149
  return this.customFields;
@@ -213,33 +207,34 @@ class GQLCapture {
213
207
  return res;
214
208
  });
215
209
  }
216
- static getResultFromMetadata(metadata, options) {
217
- let type = metadata.name;
218
- if ((type === "Number" || type === "Object") && !options?.type) {
219
- throw new Error(`type is required when accessor/function/property returns a ${type}`);
220
- }
210
+ static getField(field) {
221
211
  let list;
222
212
  let scalarType = false;
223
213
  let connection;
224
- if (options?.type) {
214
+ let type = "";
215
+ if (field?.type) {
225
216
  let r = { type: "" };
226
- getType(options.type, r);
217
+ getType(field.type, r);
227
218
  list = r.list;
228
219
  scalarType = r.scalarType || false;
229
220
  connection = r.connection;
230
221
  type = r.type;
231
222
  }
223
+ if (!type) {
224
+ throw new Error(`type is required for accessor/function/property`);
225
+ }
232
226
  if (exports.knownDisAllowedNames.has(type)) {
233
227
  throw new Error(`${type} isn't a valid type for accessor/function/property`);
234
228
  }
235
229
  let result = {
236
- name: metadata.paramName || "",
237
- type,
230
+ name: field?.name || "",
231
+ type: type,
238
232
  tsType: exports.knownAllowedNames.get(type) || this.customTypes.get(type)?.tsType,
239
- nullable: options?.nullable,
233
+ nullable: field?.nullable,
240
234
  list: list,
241
235
  connection: connection,
242
- isContextArg: metadata.isContextArg,
236
+ // @ts-ignore
237
+ isContextArg: field?.isContextArg,
243
238
  };
244
239
  // unknown type. we need to flag that this field needs to eventually be resolved
245
240
  if (!exports.knownAllowedNames.has(type)) {
@@ -251,11 +246,16 @@ class GQLCapture {
251
246
  return result;
252
247
  }
253
248
  static gqlField(options) {
254
- return function (target, propertyKey, descriptor) {
255
- if (!GQLCapture.isEnabled()) {
249
+ return function (_target, ctx) {
250
+ if (!GQLCapture.isEnabled() ||
251
+ (ctx.kind !== "method" &&
252
+ ctx.kind !== "field" &&
253
+ ctx.kind !== "getter") ||
254
+ ctx.static ||
255
+ ctx.private) {
256
256
  return;
257
257
  }
258
- let customField = GQLCapture.getCustomField(target, propertyKey, descriptor, options);
258
+ let customField = GQLCapture.getCustomField(ctx, options);
259
259
  if (!customField) {
260
260
  return;
261
261
  }
@@ -286,123 +286,73 @@ class GQLCapture {
286
286
  GQLCapture.customFields.set(customField.nodeName, list);
287
287
  };
288
288
  }
289
- static getCustomField(target, propertyKey, descriptor, options) {
289
+ static getCustomField(ctx, options, allowNoReturnType) {
290
290
  let fieldType;
291
- let nodeName = target.constructor.name;
292
291
  let args = [];
293
292
  let results = [];
294
- let typeMetadata = Reflect.getMetadata("design:type", target, propertyKey);
295
- let returnTypeMetadata = Reflect.getMetadata("design:returntype", target, propertyKey);
296
- if (returnTypeMetadata) {
297
- // function...
298
- if (returnTypeMetadata.name === "Promise") {
299
- fieldType = CustomFieldType.AsyncFunction;
300
- }
301
- else {
293
+ switch (ctx.kind) {
294
+ case "method":
302
295
  fieldType = CustomFieldType.Function;
303
- }
304
- results.push(GQLCapture.getResultFromMetadata(returnTypeMetadata, options));
305
- }
306
- else if (typeMetadata) {
307
- if (descriptor && descriptor.get) {
308
- fieldType = CustomFieldType.Accessor;
309
- }
310
- else if (descriptor && descriptor.value) {
311
- // could be implicit async
312
- fieldType = CustomFieldType.Function;
313
- }
314
- else {
296
+ if (options.async) {
297
+ fieldType = CustomFieldType.AsyncFunction;
298
+ }
299
+ break;
300
+ case "field":
315
301
  fieldType = CustomFieldType.Field;
316
- }
317
- if (!(options?.allowFunctionType &&
318
- fieldType === CustomFieldType.Function &&
319
- typeMetadata.name === "Function")) {
320
- results.push(GQLCapture.getResultFromMetadata(typeMetadata, options));
321
- }
302
+ break;
303
+ case "getter":
304
+ fieldType = CustomFieldType.Accessor;
305
+ break;
322
306
  }
323
- let params = Reflect.getMetadata("design:paramtypes", target, propertyKey);
324
- if (params && params.length > 0) {
325
- let parsedArgs = GQLCapture.argMap.get(nodeName)?.get(propertyKey) || [];
326
- if (params.length !== parsedArgs.length) {
327
- throw new Error(`args were not captured correctly, ${params.length}, ${parsedArgs.length}`);
328
- }
329
- parsedArgs.forEach((arg) => {
330
- let param = params[arg.index];
331
- let paramName = arg.name;
332
- let field = GQLCapture.getResultFromMetadata({
333
- name: param.name,
334
- paramName,
335
- isContextArg: arg.isContextArg,
336
- }, arg.options);
337
- // TODO this may not be the right order...
338
- args.push(field);
307
+ if (!allowNoReturnType && !options.type) {
308
+ throw new Error(`type is required for ${fieldType}`);
309
+ }
310
+ if (options.type) {
311
+ // override name property passed down so we return '' as name
312
+ results.push(GQLCapture.getField({ ...options, name: "" }));
313
+ }
314
+ if (options.args?.length) {
315
+ options.args.forEach((arg) => {
316
+ args.push(GQLCapture.getField(arg));
339
317
  });
340
- // TODO this is deterministically (so far) coming in reverse order so reverse (for now)
341
- args = args.reverse();
342
318
  }
343
319
  return {
344
- nodeName: nodeName,
345
- gqlName: options?.name || propertyKey,
346
- functionName: propertyKey,
320
+ nodeName: options.nodeName,
321
+ gqlName: options?.name || ctx.name.toString(),
322
+ functionName: ctx.name.toString(),
347
323
  args: args,
348
324
  results: results,
349
325
  fieldType: fieldType,
350
326
  description: options?.description,
351
327
  };
352
328
  }
353
- static argImpl(name, isContextArg, options) {
354
- return function (target, propertyKey, index) {
355
- if (!GQLCapture.isEnabled()) {
356
- return;
357
- }
358
- let nodeName = target.constructor.name;
359
- let m = GQLCapture.argMap.get(nodeName);
360
- if (!m) {
361
- m = new Map();
362
- GQLCapture.argMap.set(nodeName, m);
363
- }
364
- let propertyMap = m.get(propertyKey);
365
- if (!propertyMap) {
366
- propertyMap = [];
367
- m.set(propertyKey, propertyMap);
368
- }
369
- propertyMap.push({
370
- name: name,
371
- index: index,
372
- options: options,
373
- isContextArg,
374
- });
375
- // console.log("arg", name, target, propertyKey, index);
376
- };
377
- }
378
- // TODO custom args because for example name doesn't make sense here.
379
- static gqlArg(name, options) {
380
- return GQLCapture.argImpl(name, undefined, options);
381
- }
382
329
  static gqlContextType() {
383
- // hardcoded?
384
- return GQLCapture.argImpl("context", true, { type: "Context" });
330
+ return {
331
+ name: "context",
332
+ isContextArg: true,
333
+ type: "Context",
334
+ };
385
335
  }
386
336
  static gqlArgType(options) {
387
- return function (target, _propertyKey, _descriptor) {
388
- return GQLCapture.customGQLObject(target, GQLCapture.customArgs, options);
337
+ return function (target, ctx) {
338
+ return GQLCapture.customGQLObject(ctx, GQLCapture.customArgs, options);
389
339
  };
390
340
  }
391
341
  static gqlInputObjectType(options) {
392
- return function (target, _propertyKey, _descriptor) {
393
- return GQLCapture.customGQLObject(target, GQLCapture.customInputObjects, options);
342
+ return function (target, ctx) {
343
+ return GQLCapture.customGQLObject(ctx, GQLCapture.customInputObjects, options);
394
344
  };
395
345
  }
396
346
  static gqlObjectType(options) {
397
- return function (target, _propertyKey, _descriptor) {
398
- return GQLCapture.customGQLObject(target, GQLCapture.customObjects, options);
347
+ return function (target, ctx) {
348
+ return GQLCapture.customGQLObject(ctx, GQLCapture.customObjects, options);
399
349
  };
400
350
  }
401
- static customGQLObject(target, map, options) {
402
- if (!GQLCapture.isEnabled()) {
351
+ static customGQLObject(ctx, map, options) {
352
+ if (!GQLCapture.isEnabled() || ctx.kind !== "class" || !ctx.name) {
403
353
  return;
404
354
  }
405
- let className = target.name;
355
+ let className = ctx.name.toString();
406
356
  let nodeName = options?.name || className;
407
357
  map.set(className, {
408
358
  className,
@@ -410,28 +360,21 @@ class GQLCapture {
410
360
  description: options?.description,
411
361
  });
412
362
  }
413
- // TODO query and mutation
414
363
  // we want to specify args if any, name, response if any
415
364
  static gqlQuery(options) {
416
- return function (target, propertyKey, descriptor) {
365
+ return function (target, ctx) {
417
366
  if (!GQLCapture.isEnabled()) {
418
367
  return;
419
368
  }
420
- GQLCapture.customQueries.push(GQLCapture.getCustomField(target, propertyKey, descriptor, options));
369
+ GQLCapture.customQueries.push(GQLCapture.getCustomField(ctx, options));
421
370
  };
422
371
  }
423
- // we want to specify inputs (required), name, response
424
- // input is via gqlArg
425
- // should it be gqlInputArg?
426
372
  static gqlMutation(options) {
427
- return function (target, propertyKey, descriptor) {
373
+ return function (target, ctx) {
428
374
  if (!GQLCapture.isEnabled()) {
429
375
  return;
430
376
  }
431
- GQLCapture.customMutations.push(GQLCapture.getCustomField(target, propertyKey, descriptor, {
432
- ...options,
433
- allowFunctionType: true,
434
- }));
377
+ GQLCapture.customMutations.push(GQLCapture.getCustomField(ctx, options, true));
435
378
  };
436
379
  }
437
380
  static gqlConnection(type) {
@@ -484,7 +427,6 @@ class GQLCapture {
484
427
  resolveFields(GQLCapture.customMutations);
485
428
  }
486
429
  }
487
- exports.GQLCapture = GQLCapture;
488
430
  GQLCapture.enabled = false;
489
431
  // map from class name to fields
490
432
  GQLCapture.customFields = new Map();
@@ -494,12 +436,10 @@ GQLCapture.customArgs = new Map();
494
436
  GQLCapture.customInputObjects = new Map();
495
437
  GQLCapture.customObjects = new Map();
496
438
  GQLCapture.customTypes = new Map();
497
- // User -> add -> [{name, options}, {}, {}]
498
- GQLCapture.argMap = new Map();
439
+ exports.GQLCapture = GQLCapture;
499
440
  // why is this a static class lol?
500
441
  // TODO make all these just plain functions
501
442
  exports.gqlField = GQLCapture.gqlField;
502
- exports.gqlArg = GQLCapture.gqlArg;
503
443
  exports.gqlArgType = GQLCapture.gqlArgType;
504
444
  exports.gqlInputObjectType = GQLCapture.gqlInputObjectType;
505
445
  exports.gqlObjectType = GQLCapture.gqlObjectType;
@@ -1,4 +1,4 @@
1
- export { gqlFieldOptions, gqlObjectOptions, gqlField, gqlArg, gqlArgType, gqlInputObjectType, gqlObjectType, gqlQuery, gqlMutation, gqlContextType, gqlConnection, GraphQLConnection, GQLCapture, gqlFileUpload, CustomType, } from "./graphql";
1
+ export { gqlFieldOptions, gqlObjectOptions, gqlField, gqlArgType, gqlInputObjectType, gqlObjectType, gqlQuery, gqlMutation, gqlContextType, gqlConnection, GraphQLConnection, GQLCapture, gqlFileUpload, CustomType, } from "./graphql";
2
2
  export { GraphQLTime } from "./scalars/time";
3
3
  export { GraphQLOrderByDirection } from "./scalars/orderby_direction";
4
4
  export { GraphQLPageInfo } from "./query/page_info";
package/graphql/index.js CHANGED
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformUnionTypes = exports.encodeGQLID = exports.mustDecodeNullableIDFromGQLID = exports.mustDecodeIDFromGQLID = exports.nodeIDEncoder = exports.resolveID = exports.clearResolvers = exports.registerResolver = exports.EntNodeResolver = exports.GraphQLEdgeInterface = exports.GraphQLConnectionInterface = exports.GraphQLNodeInterface = exports.GraphQLConnectionType = exports.GraphQLEdgeType = exports.GraphQLEdgeConnection = exports.GraphQLPageInfo = exports.GraphQLOrderByDirection = exports.GraphQLTime = exports.gqlFileUpload = exports.GQLCapture = exports.gqlConnection = exports.gqlContextType = exports.gqlMutation = exports.gqlQuery = exports.gqlObjectType = exports.gqlInputObjectType = exports.gqlArgType = exports.gqlArg = exports.gqlField = void 0;
3
+ exports.transformUnionTypes = exports.encodeGQLID = exports.mustDecodeNullableIDFromGQLID = exports.mustDecodeIDFromGQLID = exports.nodeIDEncoder = exports.resolveID = exports.clearResolvers = exports.registerResolver = exports.EntNodeResolver = exports.GraphQLEdgeInterface = exports.GraphQLConnectionInterface = exports.GraphQLNodeInterface = exports.GraphQLConnectionType = exports.GraphQLEdgeType = exports.GraphQLEdgeConnection = exports.GraphQLPageInfo = exports.GraphQLOrderByDirection = exports.GraphQLTime = exports.gqlFileUpload = exports.GQLCapture = exports.gqlConnection = exports.gqlContextType = exports.gqlMutation = exports.gqlQuery = exports.gqlObjectType = exports.gqlInputObjectType = exports.gqlArgType = exports.gqlField = void 0;
4
4
  var graphql_1 = require("./graphql");
5
5
  Object.defineProperty(exports, "gqlField", { enumerable: true, get: function () { return graphql_1.gqlField; } });
6
- Object.defineProperty(exports, "gqlArg", { enumerable: true, get: function () { return graphql_1.gqlArg; } });
7
6
  Object.defineProperty(exports, "gqlArgType", { enumerable: true, get: function () { return graphql_1.gqlArgType; } });
8
7
  Object.defineProperty(exports, "gqlInputObjectType", { enumerable: true, get: function () { return graphql_1.gqlInputObjectType; } });
9
8
  Object.defineProperty(exports, "gqlObjectType", { enumerable: true, get: function () { return graphql_1.gqlObjectType; } });
@@ -1,54 +1,135 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
2
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
+ var _, done = false;
8
+ for (var i = decorators.length - 1; i >= 0; i--) {
9
+ var context = {};
10
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
+ if (kind === "accessor") {
15
+ if (result === void 0) continue;
16
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
+ if (_ = accept(result.get)) descriptor.get = _;
18
+ if (_ = accept(result.set)) descriptor.set = _;
19
+ if (_ = accept(result.init)) initializers.push(_);
20
+ }
21
+ else if (_ = accept(result)) {
22
+ if (kind === "field") initializers.push(_);
23
+ else descriptor[key] = _;
24
+ }
25
+ }
26
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
+ done = true;
7
28
  };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
29
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
+ var useValue = arguments.length > 2;
31
+ for (var i = 0; i < initializers.length; i++) {
32
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
+ }
34
+ return useValue ? value : void 0;
10
35
  };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
36
+ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
+ if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
13
39
  };
14
40
  Object.defineProperty(exports, "__esModule", { value: true });
15
41
  const graphql_1 = require("../../../graphql/graphql");
16
42
  const graphql_2 = require("graphql");
17
- let UserAuthInput = class UserAuthInput {
18
- };
19
- __decorate([
20
- (0, graphql_1.gqlField)(),
21
- __metadata("design:type", String)
22
- ], UserAuthInput.prototype, "emailAddress", void 0);
23
- __decorate([
24
- (0, graphql_1.gqlField)(),
25
- __metadata("design:type", String)
26
- ], UserAuthInput.prototype, "password", void 0);
27
- UserAuthInput = __decorate([
28
- (0, graphql_1.gqlInputObjectType)()
29
- ], UserAuthInput);
30
- let UserAuthResponse = class UserAuthResponse {
31
- };
32
- __decorate([
33
- (0, graphql_1.gqlField)(),
34
- __metadata("design:type", String)
35
- ], UserAuthResponse.prototype, "token", void 0);
36
- __decorate([
37
- (0, graphql_1.gqlField)({ type: graphql_2.GraphQLID }),
38
- __metadata("design:type", Object)
39
- ], UserAuthResponse.prototype, "viewerID", void 0);
40
- UserAuthResponse = __decorate([
41
- (0, graphql_1.gqlObjectType)()
42
- ], UserAuthResponse);
43
- class AuthResolver {
44
- async userAuth(input) {
45
- throw new Error("not implemented");
46
- }
47
- }
48
- __decorate([
49
- (0, graphql_1.gqlMutation)({ name: "userAuth", type: UserAuthResponse }),
50
- __param(0, (0, graphql_1.gqlArg)("input")),
51
- __metadata("design:type", Function),
52
- __metadata("design:paramtypes", [UserAuthInput]),
53
- __metadata("design:returntype", Promise)
54
- ], AuthResolver.prototype, "userAuth", null);
43
+ let UserAuthInput = (() => {
44
+ let _classDecorators = [(0, graphql_1.gqlInputObjectType)()];
45
+ let _classDescriptor;
46
+ let _classExtraInitializers = [];
47
+ let _classThis;
48
+ let _instanceExtraInitializers = [];
49
+ let _emailAddress_decorators;
50
+ let _emailAddress_initializers = [];
51
+ let _password_decorators;
52
+ let _password_initializers = [];
53
+ var UserAuthInput = _classThis = class {
54
+ constructor() {
55
+ this.emailAddress = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _emailAddress_initializers, void 0));
56
+ this.password = __runInitializers(this, _password_initializers, void 0);
57
+ }
58
+ };
59
+ __setFunctionName(_classThis, "UserAuthInput");
60
+ (() => {
61
+ _emailAddress_decorators = [(0, graphql_1.gqlField)({
62
+ nodeName: "UserAuthInput",
63
+ type: graphql_2.GraphQLString,
64
+ })];
65
+ _password_decorators = [(0, graphql_1.gqlField)({
66
+ nodeName: "UserAuthInput",
67
+ type: graphql_2.GraphQLString,
68
+ })];
69
+ __esDecorate(null, null, _emailAddress_decorators, { kind: "field", name: "emailAddress", static: false, private: false, access: { has: obj => "emailAddress" in obj, get: obj => obj.emailAddress, set: (obj, value) => { obj.emailAddress = value; } } }, _emailAddress_initializers, _instanceExtraInitializers);
70
+ __esDecorate(null, null, _password_decorators, { kind: "field", name: "password", static: false, private: false, access: { has: obj => "password" in obj, get: obj => obj.password, set: (obj, value) => { obj.password = value; } } }, _password_initializers, _instanceExtraInitializers);
71
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name }, null, _classExtraInitializers);
72
+ UserAuthInput = _classThis = _classDescriptor.value;
73
+ __runInitializers(_classThis, _classExtraInitializers);
74
+ })();
75
+ return UserAuthInput = _classThis;
76
+ })();
77
+ let UserAuthResponse = (() => {
78
+ let _classDecorators_1 = [(0, graphql_1.gqlObjectType)()];
79
+ let _classDescriptor_1;
80
+ let _classExtraInitializers_1 = [];
81
+ let _classThis_1;
82
+ let _instanceExtraInitializers_1 = [];
83
+ let _token_decorators;
84
+ let _token_initializers = [];
85
+ let _viewerID_decorators;
86
+ let _viewerID_initializers = [];
87
+ var UserAuthResponse = _classThis_1 = class {
88
+ constructor() {
89
+ this.token = (__runInitializers(this, _instanceExtraInitializers_1), __runInitializers(this, _token_initializers, void 0));
90
+ this.viewerID = __runInitializers(this, _viewerID_initializers, void 0);
91
+ }
92
+ };
93
+ __setFunctionName(_classThis_1, "UserAuthResponse");
94
+ (() => {
95
+ _token_decorators = [(0, graphql_1.gqlField)({
96
+ nodeName: "UserAuthResponse",
97
+ type: graphql_2.GraphQLString,
98
+ })];
99
+ _viewerID_decorators = [(0, graphql_1.gqlField)({ nodeName: "UserAuthResponses", type: graphql_2.GraphQLID })];
100
+ __esDecorate(null, null, _token_decorators, { kind: "field", name: "token", static: false, private: false, access: { has: obj => "token" in obj, get: obj => obj.token, set: (obj, value) => { obj.token = value; } } }, _token_initializers, _instanceExtraInitializers_1);
101
+ __esDecorate(null, null, _viewerID_decorators, { kind: "field", name: "viewerID", static: false, private: false, access: { has: obj => "viewerID" in obj, get: obj => obj.viewerID, set: (obj, value) => { obj.viewerID = value; } } }, _viewerID_initializers, _instanceExtraInitializers_1);
102
+ __esDecorate(null, _classDescriptor_1 = { value: _classThis_1 }, _classDecorators_1, { kind: "class", name: _classThis_1.name }, null, _classExtraInitializers_1);
103
+ UserAuthResponse = _classThis_1 = _classDescriptor_1.value;
104
+ __runInitializers(_classThis_1, _classExtraInitializers_1);
105
+ })();
106
+ return UserAuthResponse = _classThis_1;
107
+ })();
108
+ let AuthResolver = (() => {
109
+ var _a;
110
+ let _instanceExtraInitializers_2 = [];
111
+ let _userAuth_decorators;
112
+ return _a = class AuthResolver {
113
+ async userAuth(input) {
114
+ throw new Error("not implemented");
115
+ }
116
+ constructor() {
117
+ __runInitializers(this, _instanceExtraInitializers_2);
118
+ }
119
+ },
120
+ (() => {
121
+ _userAuth_decorators = [(0, graphql_1.gqlMutation)({
122
+ nodeName: "AuthResolver",
123
+ name: "userAuth",
124
+ type: UserAuthResponse,
125
+ args: [
126
+ {
127
+ name: "input",
128
+ type: UserAuthInput,
129
+ },
130
+ ],
131
+ })];
132
+ __esDecorate(_a, null, _userAuth_decorators, { kind: "method", name: "userAuth", static: false, private: false, access: { has: obj => "userAuth" in obj, get: obj => obj.userAuth } }, null, _instanceExtraInitializers_2);
133
+ })(),
134
+ _a;
135
+ })();