@nest-boot/graphql 7.0.0-beta.3 → 7.0.0-beta.4
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.
- package/dist/graphql.module-definition.d.ts +2 -1
- package/dist/graphql.module-definition.js +3 -2
- package/dist/graphql.module-definition.js.map +1 -1
- package/dist/graphql.module.d.ts +1 -8
- package/dist/graphql.module.js +36 -53
- package/dist/graphql.module.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +7 -14
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -3
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { type GraphQLModuleOptions } from "./interfaces";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const MODULE_OPTIONS_TOKEN: unique symbol;
|
|
3
|
+
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<GraphQLModuleOptions, "forRoot", "create", {}>, BASE_MODULE_OPTIONS_TOKEN: string | symbol;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.BASE_MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = exports.MODULE_OPTIONS_TOKEN = void 0;
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
|
+
exports.MODULE_OPTIONS_TOKEN = Symbol("GraphQLModuleOptions");
|
|
6
7
|
_a = new common_1.ConfigurableModuleBuilder()
|
|
7
8
|
.setClassMethodName("forRoot")
|
|
8
|
-
.build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.
|
|
9
|
+
.build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.BASE_MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN;
|
|
9
10
|
//# sourceMappingURL=graphql.module-definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.module-definition.js","sourceRoot":"","sources":["../src/graphql.module-definition.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAI9C,
|
|
1
|
+
{"version":3,"file":"graphql.module-definition.js","sourceRoot":"","sources":["../src/graphql.module-definition.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAI9C,QAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAEtD,KAGT,IAAI,kCAAyB,EAAwB;KACtD,kBAAkB,CAAC,SAAS,CAAC;KAC7B,KAAK,EAAE,EAJR,+BAAuB,+BACD,iCAAyB,2BAGtC"}
|
package/dist/graphql.module.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type ASYNC_OPTIONS_TYPE, ConfigurableModuleClass, type OPTIONS_TYPE } from "./graphql.module-definition";
|
|
3
|
-
import { type GraphQLModuleOptions } from "./interfaces";
|
|
1
|
+
import { ConfigurableModuleClass } from "./graphql.module-definition";
|
|
4
2
|
export declare class GraphQLModule extends ConfigurableModuleClass {
|
|
5
|
-
private readonly options;
|
|
6
|
-
static forRoot(options: typeof OPTIONS_TYPE): DynamicModule;
|
|
7
|
-
static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule;
|
|
8
|
-
private static withBaseGraphQLModule;
|
|
9
|
-
constructor(options: GraphQLModuleOptions);
|
|
10
3
|
}
|
package/dist/graphql.module.js
CHANGED
|
@@ -5,18 +5,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
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
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
9
|
exports.GraphQLModule = void 0;
|
|
16
10
|
const default_1 = require("@apollo/server/plugin/landingPage/default");
|
|
17
11
|
const apollo_1 = require("@nestjs/apollo");
|
|
18
12
|
const common_1 = require("@nestjs/common");
|
|
19
|
-
const common_2 = require("@nestjs/common");
|
|
20
13
|
const core_1 = require("@nestjs/core");
|
|
21
14
|
const graphql_1 = require("@nestjs/graphql");
|
|
22
15
|
const graphql_exception_filter_1 = require("./graphql.exception-filter");
|
|
@@ -24,65 +17,55 @@ const graphql_module_definition_1 = require("./graphql.module-definition");
|
|
|
24
17
|
const plugins_1 = require("./plugins");
|
|
25
18
|
const logging_plugin_1 = require("./plugins/logging.plugin");
|
|
26
19
|
let GraphQLModule = class GraphQLModule extends graphql_module_definition_1.ConfigurableModuleClass {
|
|
27
|
-
static forRoot(options) {
|
|
28
|
-
return this.withBaseGraphQLModule(super.forRoot(options));
|
|
29
|
-
}
|
|
30
|
-
static forRootAsync(options) {
|
|
31
|
-
return this.withBaseGraphQLModule(super.forRootAsync(options));
|
|
32
|
-
}
|
|
33
|
-
static withBaseGraphQLModule(dynamicModule) {
|
|
34
|
-
const BaseGraphQLDynamicModule = graphql_1.GraphQLModule.forRootAsync({
|
|
35
|
-
driver: apollo_1.ApolloDriver,
|
|
36
|
-
inject: [graphql_module_definition_1.MODULE_OPTIONS_TOKEN],
|
|
37
|
-
useFactory: (options) => {
|
|
38
|
-
if (options.playground !== false) {
|
|
39
|
-
options.playground = false;
|
|
40
|
-
options.plugins = [
|
|
41
|
-
...(options.plugins ?? []),
|
|
42
|
-
(0, default_1.ApolloServerPluginLandingPageLocalDefault)({
|
|
43
|
-
includeCookies: true,
|
|
44
|
-
}),
|
|
45
|
-
];
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
...options,
|
|
49
|
-
...(typeof options.subscriptions !== "undefined"
|
|
50
|
-
? {
|
|
51
|
-
subscriptions: {
|
|
52
|
-
"graphql-ws": options.subscriptions,
|
|
53
|
-
},
|
|
54
|
-
}
|
|
55
|
-
: {}),
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
dynamicModule.imports = [
|
|
60
|
-
...(dynamicModule.imports ?? []),
|
|
61
|
-
BaseGraphQLDynamicModule,
|
|
62
|
-
];
|
|
63
|
-
return dynamicModule;
|
|
64
|
-
}
|
|
65
|
-
constructor(options) {
|
|
66
|
-
super();
|
|
67
|
-
this.options = options;
|
|
68
|
-
}
|
|
69
20
|
};
|
|
70
21
|
exports.GraphQLModule = GraphQLModule;
|
|
71
22
|
exports.GraphQLModule = GraphQLModule = __decorate([
|
|
72
23
|
(0, common_1.Global)(),
|
|
73
24
|
(0, common_1.Module)({
|
|
25
|
+
imports: [
|
|
26
|
+
graphql_1.GraphQLModule.forRootAsync({
|
|
27
|
+
driver: apollo_1.ApolloDriver,
|
|
28
|
+
inject: [graphql_module_definition_1.MODULE_OPTIONS_TOKEN],
|
|
29
|
+
useFactory: (options) => {
|
|
30
|
+
if (options.playground !== false) {
|
|
31
|
+
options.playground = false;
|
|
32
|
+
options.plugins = [
|
|
33
|
+
...(options.plugins ?? []),
|
|
34
|
+
(0, default_1.ApolloServerPluginLandingPageLocalDefault)({
|
|
35
|
+
includeCookies: true,
|
|
36
|
+
}),
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
path: "/api/graphql",
|
|
41
|
+
autoSchemaFile: true,
|
|
42
|
+
...options,
|
|
43
|
+
...(typeof options.subscriptions !== "undefined"
|
|
44
|
+
? {
|
|
45
|
+
subscriptions: {
|
|
46
|
+
"graphql-ws": options.subscriptions,
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
: {}),
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
],
|
|
74
54
|
providers: [
|
|
75
|
-
|
|
55
|
+
common_1.Logger,
|
|
76
56
|
plugins_1.ComplexityPlugin,
|
|
77
57
|
logging_plugin_1.LoggingPlugin,
|
|
78
58
|
{
|
|
79
59
|
provide: core_1.APP_FILTER,
|
|
80
60
|
useClass: graphql_exception_filter_1.GraphQLExceptionFilter,
|
|
81
61
|
},
|
|
62
|
+
{
|
|
63
|
+
provide: graphql_module_definition_1.MODULE_OPTIONS_TOKEN,
|
|
64
|
+
inject: [{ token: graphql_module_definition_1.BASE_MODULE_OPTIONS_TOKEN, optional: true }],
|
|
65
|
+
useFactory: (options = {}) => options,
|
|
66
|
+
},
|
|
82
67
|
],
|
|
83
68
|
exports: [graphql_module_definition_1.MODULE_OPTIONS_TOKEN],
|
|
84
|
-
})
|
|
85
|
-
__param(0, (0, common_1.Inject)(graphql_module_definition_1.MODULE_OPTIONS_TOKEN)),
|
|
86
|
-
__metadata("design:paramtypes", [Object])
|
|
69
|
+
})
|
|
87
70
|
], GraphQLModule);
|
|
88
71
|
//# sourceMappingURL=graphql.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.module.js","sourceRoot":"","sources":["../src/graphql.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql.module.js","sourceRoot":"","sources":["../src/graphql.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uEAAsG;AACtG,2CAA8C;AAC9C,2CAAwD;AACxD,uCAA0C;AAC1C,6CAAqE;AAErE,yEAAoE;AACpE,2EAIqC;AAErC,uCAA6C;AAC7C,6DAAyD;AAkDlD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,mDAAuB;CAAG,CAAA;AAAhD,sCAAa;wBAAb,aAAa;IAhDzB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAiB,CAAC,YAAY,CAAC;gBAC7B,MAAM,EAAE,qBAAY;gBACpB,MAAM,EAAE,CAAC,gDAAoB,CAAC;gBAC9B,UAAU,EAAE,CAAC,OAA6B,EAAE,EAAE;oBAC5C,IAAI,OAAO,CAAC,UAAU,KAAK,KAAK,EAAE,CAAC;wBACjC,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;wBAC3B,OAAO,CAAC,OAAO,GAAG;4BAChB,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;4BAC1B,IAAA,mDAAyC,EAAC;gCACxC,cAAc,EAAE,IAAI;6BACrB,CAAC;yBACH,CAAC;oBACJ,CAAC;oBAED,OAAO;wBACL,IAAI,EAAE,cAAc;wBACpB,cAAc,EAAE,IAAI;wBACpB,GAAG,OAAO;wBACV,GAAG,CAAC,OAAO,OAAO,CAAC,aAAa,KAAK,WAAW;4BAC9C,CAAC,CAAC;gCACE,aAAa,EAAE;oCACb,YAAY,EAAE,OAAO,CAAC,aAAa;iCACpC;6BACF;4BACH,CAAC,CAAC,EAAE,CAAC;qBACR,CAAC;gBACJ,CAAC;aACF,CAAC;SACH;QACD,SAAS,EAAE;YACT,eAAM;YACN,0BAAgB;YAChB,8BAAa;YACb;gBACE,OAAO,EAAE,iBAAU;gBACnB,QAAQ,EAAE,iDAAsB;aACjC;YACD;gBACE,OAAO,EAAE,gDAAoB;gBAC7B,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,qDAAyB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;gBAC9D,UAAU,EAAE,CAAC,UAAgC,EAAE,EAAE,EAAE,CAAC,OAAO;aAC5D;SACF;QACD,OAAO,EAAE,CAAC,gDAAoB,CAAC;KAChC,CAAC;GACW,aAAa,CAAmC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export * from "./complexities";
|
|
2
|
+
export { Complexity } from "./decorators";
|
|
2
3
|
export * from "./decorators";
|
|
3
4
|
export * from "./graphql.exception-filter";
|
|
5
|
+
export { GraphQLModule } from "./graphql.module";
|
|
4
6
|
export * from "./graphql.module";
|
|
5
7
|
export * from "./interfaces";
|
|
6
8
|
export * from "./plugins";
|
|
7
9
|
export { Plugin } from "@nestjs/apollo";
|
|
8
|
-
export {
|
|
10
|
+
export { BuildSchemaOptions } from "@nestjs/graphql";
|
|
11
|
+
export * from "@nestjs/graphql";
|
|
12
|
+
export * from "graphql";
|
package/dist/index.js
CHANGED
|
@@ -14,26 +14,19 @@ 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.
|
|
17
|
+
exports.Plugin = exports.GraphQLModule = exports.Complexity = void 0;
|
|
18
18
|
__exportStar(require("./complexities"), exports);
|
|
19
|
+
var decorators_1 = require("./decorators");
|
|
20
|
+
Object.defineProperty(exports, "Complexity", { enumerable: true, get: function () { return decorators_1.Complexity; } });
|
|
19
21
|
__exportStar(require("./decorators"), exports);
|
|
20
22
|
__exportStar(require("./graphql.exception-filter"), exports);
|
|
23
|
+
var graphql_module_1 = require("./graphql.module");
|
|
24
|
+
Object.defineProperty(exports, "GraphQLModule", { enumerable: true, get: function () { return graphql_module_1.GraphQLModule; } });
|
|
21
25
|
__exportStar(require("./graphql.module"), exports);
|
|
22
26
|
__exportStar(require("./interfaces"), exports);
|
|
23
27
|
__exportStar(require("./plugins"), exports);
|
|
24
28
|
var apollo_1 = require("@nestjs/apollo");
|
|
25
29
|
Object.defineProperty(exports, "Plugin", { enumerable: true, get: function () { return apollo_1.Plugin; } });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Object.defineProperty(exports, "createUnionType", { enumerable: true, get: function () { return graphql_1.createUnionType; } });
|
|
29
|
-
Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return graphql_1.Field; } });
|
|
30
|
-
Object.defineProperty(exports, "GraphQLSchemaHost", { enumerable: true, get: function () { return graphql_1.GraphQLSchemaHost; } });
|
|
31
|
-
Object.defineProperty(exports, "ID", { enumerable: true, get: function () { return graphql_1.ID; } });
|
|
32
|
-
Object.defineProperty(exports, "InputType", { enumerable: true, get: function () { return graphql_1.InputType; } });
|
|
33
|
-
Object.defineProperty(exports, "Mutation", { enumerable: true, get: function () { return graphql_1.Mutation; } });
|
|
34
|
-
Object.defineProperty(exports, "ObjectType", { enumerable: true, get: function () { return graphql_1.ObjectType; } });
|
|
35
|
-
Object.defineProperty(exports, "Query", { enumerable: true, get: function () { return graphql_1.Query; } });
|
|
36
|
-
Object.defineProperty(exports, "registerEnumType", { enumerable: true, get: function () { return graphql_1.registerEnumType; } });
|
|
37
|
-
Object.defineProperty(exports, "ResolveField", { enumerable: true, get: function () { return graphql_1.ResolveField; } });
|
|
38
|
-
Object.defineProperty(exports, "Resolver", { enumerable: true, get: function () { return graphql_1.Resolver; } });
|
|
30
|
+
__exportStar(require("@nestjs/graphql"), exports);
|
|
31
|
+
__exportStar(require("graphql"), exports);
|
|
39
32
|
//# 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,iDAA+B;AAC/B,+CAA6B;AAC7B,6DAA2C;AAC3C,mDAAiC;AACjC,+CAA6B;AAC7B,4CAA0B;AAC1B,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,+CAA6B;AAC7B,6DAA2C;AAC3C,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,mDAAiC;AACjC,+CAA6B;AAC7B,4CAA0B;AAC1B,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;AAEf,kDAAgC;AAChC,0CAAwB"}
|