@snowtop/ent 0.1.0-alpha124 → 0.1.0-alpha125

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";
@@ -149,7 +143,6 @@ class GQLCapture {
149
143
  this.customInputObjects.clear();
150
144
  this.customObjects.clear();
151
145
  this.customTypes.clear();
152
- this.argMap.clear();
153
146
  }
154
147
  static getCustomFields() {
155
148
  return this.customFields;
@@ -213,33 +206,34 @@ class GQLCapture {
213
206
  return res;
214
207
  });
215
208
  }
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
- }
209
+ static getField(field) {
221
210
  let list;
222
211
  let scalarType = false;
223
212
  let connection;
224
- if (options?.type) {
213
+ let type = "";
214
+ if (field?.type) {
225
215
  let r = { type: "" };
226
- getType(options.type, r);
216
+ getType(field.type, r);
227
217
  list = r.list;
228
218
  scalarType = r.scalarType || false;
229
219
  connection = r.connection;
230
220
  type = r.type;
231
221
  }
222
+ if (!type) {
223
+ throw new Error(`type is required for accessor/function/property`);
224
+ }
232
225
  if (exports.knownDisAllowedNames.has(type)) {
233
226
  throw new Error(`${type} isn't a valid type for accessor/function/property`);
234
227
  }
235
228
  let result = {
236
- name: metadata.paramName || "",
237
- type,
229
+ name: field?.name || "",
230
+ type: type,
238
231
  tsType: exports.knownAllowedNames.get(type) || this.customTypes.get(type)?.tsType,
239
- nullable: options?.nullable,
232
+ nullable: field?.nullable,
240
233
  list: list,
241
234
  connection: connection,
242
- isContextArg: metadata.isContextArg,
235
+ // @ts-ignore
236
+ isContextArg: field?.isContextArg,
243
237
  };
244
238
  // unknown type. we need to flag that this field needs to eventually be resolved
245
239
  if (!exports.knownAllowedNames.has(type)) {
@@ -251,11 +245,16 @@ class GQLCapture {
251
245
  return result;
252
246
  }
253
247
  static gqlField(options) {
254
- return function (target, propertyKey, descriptor) {
255
- if (!GQLCapture.isEnabled()) {
248
+ return function (_target, ctx) {
249
+ if (!GQLCapture.isEnabled() ||
250
+ (ctx.kind !== "method" &&
251
+ ctx.kind !== "field" &&
252
+ ctx.kind !== "getter") ||
253
+ ctx.static ||
254
+ ctx.private) {
256
255
  return;
257
256
  }
258
- let customField = GQLCapture.getCustomField(target, propertyKey, descriptor, options);
257
+ let customField = GQLCapture.getCustomField(ctx, options);
259
258
  if (!customField) {
260
259
  return;
261
260
  }
@@ -286,123 +285,73 @@ class GQLCapture {
286
285
  GQLCapture.customFields.set(customField.nodeName, list);
287
286
  };
288
287
  }
289
- static getCustomField(target, propertyKey, descriptor, options) {
288
+ static getCustomField(ctx, options, allowNoReturnType) {
290
289
  let fieldType;
291
- let nodeName = target.constructor.name;
292
290
  let args = [];
293
291
  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 {
292
+ switch (ctx.kind) {
293
+ case "method":
302
294
  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 {
295
+ if (options.async) {
296
+ fieldType = CustomFieldType.AsyncFunction;
297
+ }
298
+ break;
299
+ case "field":
315
300
  fieldType = CustomFieldType.Field;
316
- }
317
- if (!(options?.allowFunctionType &&
318
- fieldType === CustomFieldType.Function &&
319
- typeMetadata.name === "Function")) {
320
- results.push(GQLCapture.getResultFromMetadata(typeMetadata, options));
321
- }
301
+ break;
302
+ case "getter":
303
+ fieldType = CustomFieldType.Accessor;
304
+ break;
322
305
  }
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);
306
+ if (!allowNoReturnType && !options.type) {
307
+ throw new Error(`type is required for ${fieldType}`);
308
+ }
309
+ if (options.type) {
310
+ // override name property passed down so we return '' as name
311
+ results.push(GQLCapture.getField({ ...options, name: "" }));
312
+ }
313
+ if (options.args?.length) {
314
+ options.args.forEach((arg) => {
315
+ args.push(GQLCapture.getField(arg));
339
316
  });
340
- // TODO this is deterministically (so far) coming in reverse order so reverse (for now)
341
- args = args.reverse();
342
317
  }
343
318
  return {
344
- nodeName: nodeName,
345
- gqlName: options?.name || propertyKey,
346
- functionName: propertyKey,
319
+ nodeName: options.nodeName,
320
+ gqlName: options?.name || ctx.name.toString(),
321
+ functionName: ctx.name.toString(),
347
322
  args: args,
348
323
  results: results,
349
324
  fieldType: fieldType,
350
325
  description: options?.description,
351
326
  };
352
327
  }
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
328
  static gqlContextType() {
383
- // hardcoded?
384
- return GQLCapture.argImpl("context", true, { type: "Context" });
329
+ return {
330
+ name: "context",
331
+ isContextArg: true,
332
+ type: "Context",
333
+ };
385
334
  }
386
335
  static gqlArgType(options) {
387
- return function (target, _propertyKey, _descriptor) {
388
- return GQLCapture.customGQLObject(target, GQLCapture.customArgs, options);
336
+ return function (target, ctx) {
337
+ return GQLCapture.customGQLObject(ctx, GQLCapture.customArgs, options);
389
338
  };
390
339
  }
391
340
  static gqlInputObjectType(options) {
392
- return function (target, _propertyKey, _descriptor) {
393
- return GQLCapture.customGQLObject(target, GQLCapture.customInputObjects, options);
341
+ return function (target, ctx) {
342
+ return GQLCapture.customGQLObject(ctx, GQLCapture.customInputObjects, options);
394
343
  };
395
344
  }
396
345
  static gqlObjectType(options) {
397
- return function (target, _propertyKey, _descriptor) {
398
- return GQLCapture.customGQLObject(target, GQLCapture.customObjects, options);
346
+ return function (target, ctx) {
347
+ return GQLCapture.customGQLObject(ctx, GQLCapture.customObjects, options);
399
348
  };
400
349
  }
401
- static customGQLObject(target, map, options) {
402
- if (!GQLCapture.isEnabled()) {
350
+ static customGQLObject(ctx, map, options) {
351
+ if (!GQLCapture.isEnabled() || ctx.kind !== "class" || !ctx.name) {
403
352
  return;
404
353
  }
405
- let className = target.name;
354
+ let className = ctx.name.toString();
406
355
  let nodeName = options?.name || className;
407
356
  map.set(className, {
408
357
  className,
@@ -410,28 +359,21 @@ class GQLCapture {
410
359
  description: options?.description,
411
360
  });
412
361
  }
413
- // TODO query and mutation
414
362
  // we want to specify args if any, name, response if any
415
363
  static gqlQuery(options) {
416
- return function (target, propertyKey, descriptor) {
364
+ return function (target, ctx) {
417
365
  if (!GQLCapture.isEnabled()) {
418
366
  return;
419
367
  }
420
- GQLCapture.customQueries.push(GQLCapture.getCustomField(target, propertyKey, descriptor, options));
368
+ GQLCapture.customQueries.push(GQLCapture.getCustomField(ctx, options));
421
369
  };
422
370
  }
423
- // we want to specify inputs (required), name, response
424
- // input is via gqlArg
425
- // should it be gqlInputArg?
426
371
  static gqlMutation(options) {
427
- return function (target, propertyKey, descriptor) {
372
+ return function (target, ctx) {
428
373
  if (!GQLCapture.isEnabled()) {
429
374
  return;
430
375
  }
431
- GQLCapture.customMutations.push(GQLCapture.getCustomField(target, propertyKey, descriptor, {
432
- ...options,
433
- allowFunctionType: true,
434
- }));
376
+ GQLCapture.customMutations.push(GQLCapture.getCustomField(ctx, options, true));
435
377
  };
436
378
  }
437
379
  static gqlConnection(type) {
@@ -484,7 +426,6 @@ class GQLCapture {
484
426
  resolveFields(GQLCapture.customMutations);
485
427
  }
486
428
  }
487
- exports.GQLCapture = GQLCapture;
488
429
  GQLCapture.enabled = false;
489
430
  // map from class name to fields
490
431
  GQLCapture.customFields = new Map();
@@ -494,12 +435,10 @@ GQLCapture.customArgs = new Map();
494
435
  GQLCapture.customInputObjects = new Map();
495
436
  GQLCapture.customObjects = new Map();
496
437
  GQLCapture.customTypes = new Map();
497
- // User -> add -> [{name, options}, {}, {}]
498
- GQLCapture.argMap = new Map();
438
+ exports.GQLCapture = GQLCapture;
499
439
  // why is this a static class lol?
500
440
  // TODO make all these just plain functions
501
441
  exports.gqlField = GQLCapture.gqlField;
502
- exports.gqlArg = GQLCapture.gqlArg;
503
442
  exports.gqlArgType = GQLCapture.gqlArgType;
504
443
  exports.gqlInputObjectType = GQLCapture.gqlInputObjectType;
505
444
  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
+ })();