@nest-boot/graphql 7.0.0-beta.7 → 7.1.0

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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Decorator that marks a class as a resolver arguments type.
3
+ *
4
+ * @publicApi
5
+ */
6
+ export declare function ArgsType(name?: string): ClassDecorator;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArgsType = ArgsType;
4
+ const class_type_enum_1 = require("@nestjs/graphql/dist/enums/class-type.enum");
5
+ const lazy_metadata_storage_1 = require("@nestjs/graphql/dist/schema-builder/storages/lazy-metadata.storage");
6
+ const type_metadata_storage_1 = require("@nestjs/graphql/dist/schema-builder/storages/type-metadata.storage");
7
+ const add_class_type_metadata_util_1 = require("@nestjs/graphql/dist/utils/add-class-type-metadata.util");
8
+ /**
9
+ * Decorator that marks a class as a resolver arguments type.
10
+ *
11
+ * @publicApi
12
+ */
13
+ function ArgsType(name) {
14
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
15
+ return (target) => {
16
+ const metadata = {
17
+ name: name ?? target.name,
18
+ target,
19
+ };
20
+ lazy_metadata_storage_1.LazyMetadataStorage.store(() => {
21
+ type_metadata_storage_1.TypeMetadataStorage.addArgsMetadata(metadata);
22
+ });
23
+ // This function must be called eagerly to allow resolvers
24
+ // accessing the "name" property
25
+ type_metadata_storage_1.TypeMetadataStorage.addArgsMetadata(metadata);
26
+ (0, add_class_type_metadata_util_1.addClassTypeMetadata)(target, class_type_enum_1.ClassType.ARGS);
27
+ };
28
+ }
29
+ //# sourceMappingURL=args-type.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"args-type.decorator.js","sourceRoot":"","sources":["../../src/decorators/args-type.decorator.ts"],"names":[],"mappings":";;AAUA,4BAeC;AAzBD,gFAAuE;AACvE,8GAAyG;AACzG,8GAAyG;AACzG,0GAA+F;AAE/F;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,IAAa;IACpC,sEAAsE;IACtE,OAAO,CAAC,MAAgB,EAAE,EAAE;QAC1B,MAAM,QAAQ,GAAG;YACf,IAAI,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI;YACzB,MAAM;SACP,CAAC;QACF,2CAAmB,CAAC,KAAK,CAAC,GAAG,EAAE;YAC7B,2CAAmB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QACH,0DAA0D;QAC1D,gCAAgC;QAChC,2CAAmB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAA,mDAAoB,EAAC,MAAM,EAAE,2BAAS,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
+ export { ArgsType } from "./decorators/args-type.decorator";
1
2
  export * from "./graphql.exception-filter";
2
3
  export { GraphQLModule } from "./graphql.module";
3
4
  export { Plugin } from "@nestjs/apollo";
4
- export type { BuildSchemaOptions } from "@nestjs/graphql";
5
5
  export * from "@nestjs/graphql";
6
- export * from "graphql";
package/dist/index.js CHANGED
@@ -14,12 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Plugin = exports.GraphQLModule = void 0;
17
+ exports.Plugin = exports.GraphQLModule = exports.ArgsType = void 0;
18
+ var args_type_decorator_1 = require("./decorators/args-type.decorator");
19
+ Object.defineProperty(exports, "ArgsType", { enumerable: true, get: function () { return args_type_decorator_1.ArgsType; } });
18
20
  __exportStar(require("./graphql.exception-filter"), exports);
19
21
  var graphql_module_1 = require("./graphql.module");
20
22
  Object.defineProperty(exports, "GraphQLModule", { enumerable: true, get: function () { return graphql_module_1.GraphQLModule; } });
21
23
  var apollo_1 = require("@nestjs/apollo");
22
24
  Object.defineProperty(exports, "Plugin", { enumerable: true, get: function () { return apollo_1.Plugin; } });
23
25
  __exportStar(require("@nestjs/graphql"), exports);
24
- __exportStar(require("graphql"), exports);
25
26
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;AAEf,kDAAgC;AAChC,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wEAA4D;AAAnD,+GAAA,QAAQ,OAAA;AACjB,6DAA2C;AAC3C,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;AACf,kDAAgC"}