@loopback/example-graphql 0.4.1 → 0.6.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.
- package/dist/application.d.ts +2 -2
- package/dist/application.js +7 -2
- package/dist/application.js.map +1 -1
- package/dist/datasources/index.js +1 -1
- package/dist/datasources/index.js.map +1 -1
- package/dist/datasources/recipes.datasource.js +4 -4
- package/dist/datasources/recipes.datasource.js.map +1 -1
- package/dist/graphql-resolvers/recipe-resolver.js +44 -44
- package/dist/graphql-resolvers/recipe-resolver.js.map +1 -1
- package/dist/graphql-types/recipe-input.js +11 -11
- package/dist/graphql-types/recipe-input.js.map +1 -1
- package/dist/graphql-types/recipe-type.js +43 -43
- package/dist/graphql-types/recipe-type.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/repositories/index.js +1 -1
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/recipe.repository.js +9 -9
- package/dist/repositories/recipe.repository.js.map +1 -1
- package/dist/sample-recipes.js +1 -1
- package/dist/sample-recipes.js.map +1 -1
- package/dist/services/recipe.service.js +2 -2
- package/dist/services/recipe.service.js.map +1 -1
- package/package.json +16 -16
- package/src/application.ts +7 -0
package/dist/application.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ declare const GraphqlDemoApplication_base: (new (...args: any[]) => {
|
|
|
43
43
|
unsubscribe: (observer: import("@loopback/core").ContextEventObserver) => boolean;
|
|
44
44
|
close: () => void;
|
|
45
45
|
isSubscribed: (observer: import("@loopback/core").ContextObserver) => boolean;
|
|
46
|
-
createView: <T_7 = unknown>(filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined) => import("@loopback/core").ContextView<T_7>;
|
|
46
|
+
createView: <T_7 = unknown>(filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined, options?: Omit<import("@loopback/core").ResolutionOptions, "session"> | undefined) => import("@loopback/core").ContextView<T_7>;
|
|
47
47
|
contains: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
48
48
|
isBound: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
49
49
|
getOwnerContext: (keyOrBinding: import("@loopback/core").BindingAddress<unknown> | Readonly<import("@loopback/boot").Binding<unknown>>) => import("@loopback/core").Context | undefined;
|
|
@@ -133,7 +133,7 @@ declare const GraphqlDemoApplication_base: (new (...args: any[]) => {
|
|
|
133
133
|
unsubscribe: (observer: import("@loopback/core").ContextEventObserver) => boolean;
|
|
134
134
|
close: () => void;
|
|
135
135
|
isSubscribed: (observer: import("@loopback/core").ContextObserver) => boolean;
|
|
136
|
-
createView: <T_7_1 = unknown>(filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined) => import("@loopback/core").ContextView<T_7_1>;
|
|
136
|
+
createView: <T_7_1 = unknown>(filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined, options?: Omit<import("@loopback/core").ResolutionOptions, "session"> | undefined) => import("@loopback/core").ContextView<T_7_1>;
|
|
137
137
|
contains: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
138
138
|
isBound: (key: import("@loopback/core").BindingAddress<unknown>) => boolean;
|
|
139
139
|
getOwnerContext: (keyOrBinding: import("@loopback/core").BindingAddress<unknown> | Readonly<import("@loopback/boot").Binding<unknown>>) => import("@loopback/core").Context | undefined;
|
package/dist/application.js
CHANGED
|
@@ -10,13 +10,18 @@ const boot_1 = require("@loopback/boot");
|
|
|
10
10
|
const graphql_1 = require("@loopback/graphql");
|
|
11
11
|
const repository_1 = require("@loopback/repository");
|
|
12
12
|
const rest_1 = require("@loopback/rest");
|
|
13
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
13
|
+
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
14
14
|
const sample_recipes_1 = require("./sample-recipes");
|
|
15
|
-
class GraphqlDemoApplication extends boot_1.BootMixin(repository_1.RepositoryMixin(rest_1.RestApplication)) {
|
|
15
|
+
class GraphqlDemoApplication extends (0, boot_1.BootMixin)((0, repository_1.RepositoryMixin)(rest_1.RestApplication)) {
|
|
16
16
|
constructor(options = {}) {
|
|
17
17
|
super(options);
|
|
18
18
|
this.component(graphql_1.GraphQLComponent);
|
|
19
19
|
const server = this.getSync(graphql_1.GraphQLBindings.GRAPHQL_SERVER);
|
|
20
|
+
// To register one or more middlewares as per https://typegraphql.com/docs/middlewares.html
|
|
21
|
+
server.middleware((resolverData, next) => {
|
|
22
|
+
// It's invoked for each field resolver, query and mutation operations
|
|
23
|
+
return next();
|
|
24
|
+
});
|
|
20
25
|
this.expressMiddleware('middleware.express.GraphQL', server.expressApp);
|
|
21
26
|
// It's possible to register a graphql context resolver
|
|
22
27
|
this.bind(graphql_1.GraphQLBindings.GRAPHQL_CONTEXT_RESOLVER).to(context => {
|
package/dist/application.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAAyC;AAEzC,+CAAoE;AACpE,qDAAqD;AACrD,yCAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAAyC;AAEzC,+CAAoE;AACpE,qDAAqD;AACrD,yCAA+C;AAC/C,6DAAwB;AACxB,qDAA+C;AAI/C,MAAa,sBAAuB,SAAQ,IAAA,gBAAS,EACnD,IAAA,4BAAe,EAAC,sBAAe,CAAC,CACjC;IACC,YAAY,UAA6B,EAAE;QACzC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,SAAS,CAAC,0BAAgB,CAAC,CAAC;QAEjC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,yBAAe,CAAC,cAAc,CAAC,CAAC;QAC5D,2FAA2F;QAC3F,MAAM,CAAC,UAAU,CAAC,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE;YACvC,sEAAsE;YACtE,OAAO,IAAI,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,CAAC,4BAA4B,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;QAExE,uDAAuD;QACvD,IAAI,CAAC,IAAI,CAAC,yBAAe,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE;YAC/D,OAAO,EAAC,GAAG,OAAO,EAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,8BAAa,CAAC,CAAC,CAAC;QAE5C,2BAA2B;QAC3B,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;QAEpD,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,mDAAmD;QACnD,IAAI,CAAC,WAAW,GAAG;YACjB,gBAAgB,EAAE;gBAChB,8CAA8C;gBAC9C,IAAI,EAAE,CAAC,mBAAmB,CAAC;gBAC3B,UAAU,EAAE,CAAC,KAAK,CAAC;gBACnB,MAAM,EAAE,IAAI;aACb;SACF,CAAC;IACJ,CAAC;CACF;AAtCD,wDAsCC"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
|
-
tslib_1.__exportStar(require("./recipes.datasource"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./recipes.datasource"), exports);
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/datasources/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;AAEhE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/datasources/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,oEAAqC"}
|
|
@@ -25,15 +25,15 @@ let RecipesDataSource = class RecipesDataSource extends repository_1.juggler.Dat
|
|
|
25
25
|
};
|
|
26
26
|
RecipesDataSource.dataSourceName = 'recipes';
|
|
27
27
|
RecipesDataSource.defaultConfig = config;
|
|
28
|
-
RecipesDataSource = tslib_1.__decorate([
|
|
29
|
-
core_1.lifeCycleObserver('datasource', {
|
|
28
|
+
RecipesDataSource = (0, tslib_1.__decorate)([
|
|
29
|
+
(0, core_1.lifeCycleObserver)('datasource', {
|
|
30
30
|
tags: {
|
|
31
31
|
[core_1.ContextTags.NAME]: 'recipes',
|
|
32
32
|
[core_1.ContextTags.NAMESPACE]: repository_1.RepositoryBindings.DATASOURCES,
|
|
33
33
|
},
|
|
34
34
|
}),
|
|
35
|
-
tslib_1.__param(0, core_1.inject('datasources.config.recipes', { optional: true })),
|
|
36
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
35
|
+
(0, tslib_1.__param)(0, (0, core_1.inject)('datasources.config.recipes', { optional: true })),
|
|
36
|
+
(0, tslib_1.__metadata)("design:paramtypes", [Object])
|
|
37
37
|
], RecipesDataSource);
|
|
38
38
|
exports.RecipesDataSource = RecipesDataSource;
|
|
39
39
|
//# sourceMappingURL=recipes.datasource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipes.datasource.js","sourceRoot":"","sources":["../../src/datasources/recipes.datasource.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC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CAAC;IASG,wBAAA,IAAA,aAAM,EAAC,4BAA4B,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAA;;GAR9C,iBAAiB,CAa7B;AAbY,8CAAiB"}
|
|
@@ -45,56 +45,56 @@ let RecipeResolver = class RecipeResolver {
|
|
|
45
45
|
return this.recipeService.ratingsCount(recipe, minRate);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
tslib_1.__decorate([
|
|
49
|
-
graphql_1.query(returns => recipe_type_1.Recipe, { nullable: true }),
|
|
50
|
-
graphql_1.authorized('owner'),
|
|
51
|
-
tslib_1.__param(0, graphql_1.arg('recipeId')),
|
|
52
|
-
tslib_1.__metadata("design:type", Function),
|
|
53
|
-
tslib_1.__metadata("design:paramtypes", [String]),
|
|
54
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
48
|
+
(0, tslib_1.__decorate)([
|
|
49
|
+
(0, graphql_1.query)(returns => recipe_type_1.Recipe, { nullable: true }),
|
|
50
|
+
(0, graphql_1.authorized)('owner'),
|
|
51
|
+
(0, tslib_1.__param)(0, (0, graphql_1.arg)('recipeId')),
|
|
52
|
+
(0, tslib_1.__metadata)("design:type", Function),
|
|
53
|
+
(0, tslib_1.__metadata)("design:paramtypes", [String]),
|
|
54
|
+
(0, tslib_1.__metadata)("design:returntype", Promise)
|
|
55
55
|
], RecipeResolver.prototype, "recipe", null);
|
|
56
|
-
tslib_1.__decorate([
|
|
57
|
-
graphql_1.query(returns => [recipe_type_1.Recipe]),
|
|
58
|
-
tslib_1.__metadata("design:type", Function),
|
|
59
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
60
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
56
|
+
(0, tslib_1.__decorate)([
|
|
57
|
+
(0, graphql_1.query)(returns => [recipe_type_1.Recipe]),
|
|
58
|
+
(0, tslib_1.__metadata)("design:type", Function),
|
|
59
|
+
(0, tslib_1.__metadata)("design:paramtypes", []),
|
|
60
|
+
(0, tslib_1.__metadata)("design:returntype", Promise)
|
|
61
61
|
], RecipeResolver.prototype, "recipes", null);
|
|
62
|
-
tslib_1.__decorate([
|
|
63
|
-
graphql_1.mutation(returns => recipe_type_1.Recipe),
|
|
64
|
-
tslib_1.__param(0, graphql_1.arg('recipe')),
|
|
65
|
-
tslib_1.__param(1, graphql_1.pubSub('recipeCreated')),
|
|
66
|
-
tslib_1.__metadata("design:type", Function),
|
|
67
|
-
tslib_1.__metadata("design:paramtypes", [recipe_input_1.RecipeInput, Function]),
|
|
68
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
62
|
+
(0, tslib_1.__decorate)([
|
|
63
|
+
(0, graphql_1.mutation)(returns => recipe_type_1.Recipe),
|
|
64
|
+
(0, tslib_1.__param)(0, (0, graphql_1.arg)('recipe')),
|
|
65
|
+
(0, tslib_1.__param)(1, (0, graphql_1.pubSub)('recipeCreated')),
|
|
66
|
+
(0, tslib_1.__metadata)("design:type", Function),
|
|
67
|
+
(0, tslib_1.__metadata)("design:paramtypes", [recipe_input_1.RecipeInput, Function]),
|
|
68
|
+
(0, tslib_1.__metadata)("design:returntype", Promise)
|
|
69
69
|
], RecipeResolver.prototype, "addRecipe", null);
|
|
70
|
-
tslib_1.__decorate([
|
|
71
|
-
graphql_1.subscription(returns => recipe_type_1.Recipe, { topics: 'recipeCreated' }),
|
|
72
|
-
tslib_1.__param(0, graphql_1.root()),
|
|
73
|
-
tslib_1.__metadata("design:type", Function),
|
|
74
|
-
tslib_1.__metadata("design:paramtypes", [recipe_type_1.Recipe]),
|
|
75
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
70
|
+
(0, tslib_1.__decorate)([
|
|
71
|
+
(0, graphql_1.subscription)(returns => recipe_type_1.Recipe, { topics: 'recipeCreated' }),
|
|
72
|
+
(0, tslib_1.__param)(0, (0, graphql_1.root)()),
|
|
73
|
+
(0, tslib_1.__metadata)("design:type", Function),
|
|
74
|
+
(0, tslib_1.__metadata)("design:paramtypes", [recipe_type_1.Recipe]),
|
|
75
|
+
(0, tslib_1.__metadata)("design:returntype", Promise)
|
|
76
76
|
], RecipeResolver.prototype, "recipeCreated", null);
|
|
77
|
-
tslib_1.__decorate([
|
|
78
|
-
graphql_1.fieldResolver(),
|
|
79
|
-
tslib_1.__param(0, graphql_1.root()),
|
|
80
|
-
tslib_1.__metadata("design:type", Function),
|
|
81
|
-
tslib_1.__metadata("design:paramtypes", [recipe_type_1.Recipe]),
|
|
82
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
77
|
+
(0, tslib_1.__decorate)([
|
|
78
|
+
(0, graphql_1.fieldResolver)(),
|
|
79
|
+
(0, tslib_1.__param)(0, (0, graphql_1.root)()),
|
|
80
|
+
(0, tslib_1.__metadata)("design:type", Function),
|
|
81
|
+
(0, tslib_1.__metadata)("design:paramtypes", [recipe_type_1.Recipe]),
|
|
82
|
+
(0, tslib_1.__metadata)("design:returntype", Promise)
|
|
83
83
|
], RecipeResolver.prototype, "numberInCollection", null);
|
|
84
|
-
tslib_1.__decorate([
|
|
85
|
-
graphql_1.fieldResolver(),
|
|
86
|
-
tslib_1.__param(0, graphql_1.root()),
|
|
87
|
-
tslib_1.__param(1, graphql_1.arg('minRate', type => graphql_1.Int, { defaultValue: 0.0 })),
|
|
88
|
-
tslib_1.__metadata("design:type", Function),
|
|
89
|
-
tslib_1.__metadata("design:paramtypes", [recipe_type_1.Recipe, Number]),
|
|
90
|
-
tslib_1.__metadata("design:returntype", Number)
|
|
84
|
+
(0, tslib_1.__decorate)([
|
|
85
|
+
(0, graphql_1.fieldResolver)(),
|
|
86
|
+
(0, tslib_1.__param)(0, (0, graphql_1.root)()),
|
|
87
|
+
(0, tslib_1.__param)(1, (0, graphql_1.arg)('minRate', type => graphql_1.Int, { defaultValue: 0.0 })),
|
|
88
|
+
(0, tslib_1.__metadata)("design:type", Function),
|
|
89
|
+
(0, tslib_1.__metadata)("design:paramtypes", [recipe_type_1.Recipe, Number]),
|
|
90
|
+
(0, tslib_1.__metadata)("design:returntype", Number)
|
|
91
91
|
], RecipeResolver.prototype, "ratingsCount", null);
|
|
92
|
-
RecipeResolver = tslib_1.__decorate([
|
|
93
|
-
graphql_1.resolver(of => recipe_type_1.Recipe),
|
|
94
|
-
tslib_1.__param(0, repository_1.repository('RecipeRepository')),
|
|
95
|
-
tslib_1.__param(1, core_1.service(recipe_service_1.RecipeService)),
|
|
96
|
-
tslib_1.__param(2, core_1.inject(graphql_1.GraphQLBindings.RESOLVER_DATA)),
|
|
97
|
-
tslib_1.__metadata("design:paramtypes", [repositories_1.RecipeRepository,
|
|
92
|
+
RecipeResolver = (0, tslib_1.__decorate)([
|
|
93
|
+
(0, graphql_1.resolver)(of => recipe_type_1.Recipe),
|
|
94
|
+
(0, tslib_1.__param)(0, (0, repository_1.repository)('RecipeRepository')),
|
|
95
|
+
(0, tslib_1.__param)(1, (0, core_1.service)(recipe_service_1.RecipeService)),
|
|
96
|
+
(0, tslib_1.__param)(2, (0, core_1.inject)(graphql_1.GraphQLBindings.RESOLVER_DATA)),
|
|
97
|
+
(0, tslib_1.__metadata)("design:paramtypes", [repositories_1.RecipeRepository,
|
|
98
98
|
recipe_service_1.RecipeService, Object])
|
|
99
99
|
], RecipeResolver);
|
|
100
100
|
exports.RecipeResolver = RecipeResolver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe-resolver.js","sourceRoot":"","sources":["../../src/graphql-resolvers/recipe-resolver.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAA+C;AAC/C,+CAe2B;AAC3B,qDAAgD;AAChD,gEAA0D;AAC1D,8DAAoD;AACpD,kDAAiD;AACjD,+DAAyD;AAGzD,IAAa,cAAc,GAA3B,MAAa,cAAc;IACzB;IACE,mCAAmC;IAElB,UAA4B,EACJ,aAA4B;IACrE,4CAA4C;IACG,YAA0B;QAHxD,eAAU,GAAV,UAAU,CAAkB;QACJ,kBAAa,GAAb,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B;AAGD;IADC,IAAA,kBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,oBAAM,CAAC;IAEzB,wBAAA,IAAA,aAAG,EAAC,QAAQ,CAAC,CAAA;IACb,wBAAA,IAAA,gBAAM,EAAC,eAAe,CAAC,CAAA;;kDADD,0BAAW;;+CAMnC;AAGD;IADC,IAAA,sBAAY,EAAC,OAAO,CAAC,EAAE,CAAC,oBAAM,EAAE,EAAC,MAAM,EAAE,eAAe,EAAC,CAAC;IACtC,wBAAA,IAAA,cAAI,GAAE,CAAA;;kDAAS,oBAAM;;mDAEzC;AAGD;IADC,IAAA,uBAAa,GAAE;IACU,wBAAA,IAAA,cAAI,GAAE,CAAA;;kDAAS,oBAAM;;wDAG9C;AAGD;IADC,IAAA,uBAAa,GAAE;IAEb,wBAAA,IAAA,cAAI,GAAE,CAAA;IACN,wBAAA,IAAA,aAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,aAAG,EAAE,EAAC,YAAY,EAAE,GAAG,EAAC,CAAC,CAAA;;kDADjC,oBAAM;;kDAKvB;AAjDU,cAAc;IAD1B,IAAA,kBAAQ,EAAC,EAAE,CAAC,EAAE,CAAC,oBAAM,CAAC;IAIlB,wBAAA,IAAA,uBAAU,EAAC,kBAAkB,CAAC,CAAA;IAE9B,wBAAA,IAAA,cAAO,EAAC,8BAAa,CAAC,CAAA;IAEtB,wBAAA,IAAA,aAAM,EAAC,yBAAe,CAAC,aAAa,CAAC,CAAA;kDAHT,+BAAgB;QACW,8BAAa;GAL5D,cAAc,CAkD1B;AAlDY,wCAAc"}
|
|
@@ -9,20 +9,20 @@ const tslib_1 = require("tslib");
|
|
|
9
9
|
const graphql_1 = require("@loopback/graphql");
|
|
10
10
|
let RecipeInput = class RecipeInput {
|
|
11
11
|
};
|
|
12
|
-
tslib_1.__decorate([
|
|
13
|
-
graphql_1.field(),
|
|
14
|
-
tslib_1.__metadata("design:type", String)
|
|
12
|
+
(0, tslib_1.__decorate)([
|
|
13
|
+
(0, graphql_1.field)(),
|
|
14
|
+
(0, tslib_1.__metadata)("design:type", String)
|
|
15
15
|
], RecipeInput.prototype, "title", void 0);
|
|
16
|
-
tslib_1.__decorate([
|
|
17
|
-
graphql_1.field({ nullable: true }),
|
|
18
|
-
tslib_1.__metadata("design:type", String)
|
|
16
|
+
(0, tslib_1.__decorate)([
|
|
17
|
+
(0, graphql_1.field)({ nullable: true }),
|
|
18
|
+
(0, tslib_1.__metadata)("design:type", String)
|
|
19
19
|
], RecipeInput.prototype, "description", void 0);
|
|
20
|
-
tslib_1.__decorate([
|
|
21
|
-
graphql_1.field(type => [String]),
|
|
22
|
-
tslib_1.__metadata("design:type", Array)
|
|
20
|
+
(0, tslib_1.__decorate)([
|
|
21
|
+
(0, graphql_1.field)(type => [String]),
|
|
22
|
+
(0, tslib_1.__metadata)("design:type", Array)
|
|
23
23
|
], RecipeInput.prototype, "ingredients", void 0);
|
|
24
|
-
RecipeInput = tslib_1.__decorate([
|
|
25
|
-
graphql_1.inputType()
|
|
24
|
+
RecipeInput = (0, tslib_1.__decorate)([
|
|
25
|
+
(0, graphql_1.inputType)()
|
|
26
26
|
], RecipeInput);
|
|
27
27
|
exports.RecipeInput = RecipeInput;
|
|
28
28
|
//# sourceMappingURL=recipe-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe-input.js","sourceRoot":"","sources":["../../src/graphql-types/recipe-input.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAAmD;AAInD,IAAa,WAAW,GAAxB,MAAa,WAAW;CASvB,CAAA;AAPC;IADC,eAAK,
|
|
1
|
+
{"version":3,"file":"recipe-input.js","sourceRoot":"","sources":["../../src/graphql-types/recipe-input.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAAmD;AAInD,IAAa,WAAW,GAAxB,MAAa,WAAW;CASvB,CAAA;AAPC;IADC,IAAA,eAAK,GAAE;;0CACM;AAGd;IADC,IAAA,eAAK,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;gDACH;AAGrB;IADC,IAAA,eAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;;gDACF;AARX,WAAW;IADvB,IAAA,mBAAS,GAAE;GACC,WAAW,CASvB;AATY,kCAAW"}
|
|
@@ -24,66 +24,66 @@ let Recipe = class Recipe extends repository_1.Entity {
|
|
|
24
24
|
return ratingsSum / ratingsCount;
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
tslib_1.__decorate([
|
|
28
|
-
graphql_1.field(type => graphql_1.ID),
|
|
29
|
-
repository_1.property({ id: true }),
|
|
30
|
-
tslib_1.__metadata("design:type", String)
|
|
27
|
+
(0, tslib_1.__decorate)([
|
|
28
|
+
(0, graphql_1.field)(type => graphql_1.ID),
|
|
29
|
+
(0, repository_1.property)({ id: true }),
|
|
30
|
+
(0, tslib_1.__metadata)("design:type", String)
|
|
31
31
|
], Recipe.prototype, "id", void 0);
|
|
32
|
-
tslib_1.__decorate([
|
|
33
|
-
graphql_1.field(),
|
|
34
|
-
repository_1.property(),
|
|
35
|
-
tslib_1.__metadata("design:type", String)
|
|
32
|
+
(0, tslib_1.__decorate)([
|
|
33
|
+
(0, graphql_1.field)(),
|
|
34
|
+
(0, repository_1.property)(),
|
|
35
|
+
(0, tslib_1.__metadata)("design:type", String)
|
|
36
36
|
], Recipe.prototype, "title", void 0);
|
|
37
|
-
tslib_1.__decorate([
|
|
38
|
-
graphql_1.field(type => String, {
|
|
37
|
+
(0, tslib_1.__decorate)([
|
|
38
|
+
(0, graphql_1.field)(type => String, {
|
|
39
39
|
nullable: true,
|
|
40
40
|
deprecationReason: 'Use `description` field instead',
|
|
41
41
|
}),
|
|
42
|
-
tslib_1.__metadata("design:type", Object),
|
|
43
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
42
|
+
(0, tslib_1.__metadata)("design:type", Object),
|
|
43
|
+
(0, tslib_1.__metadata)("design:paramtypes", [])
|
|
44
44
|
], Recipe.prototype, "specification", null);
|
|
45
|
-
tslib_1.__decorate([
|
|
46
|
-
graphql_1.field({
|
|
45
|
+
(0, tslib_1.__decorate)([
|
|
46
|
+
(0, graphql_1.field)({
|
|
47
47
|
nullable: true,
|
|
48
48
|
description: 'The recipe description with preparation info',
|
|
49
49
|
}),
|
|
50
|
-
repository_1.property(),
|
|
51
|
-
tslib_1.__metadata("design:type", String)
|
|
50
|
+
(0, repository_1.property)(),
|
|
51
|
+
(0, tslib_1.__metadata)("design:type", String)
|
|
52
52
|
], Recipe.prototype, "description", void 0);
|
|
53
|
-
tslib_1.__decorate([
|
|
54
|
-
graphql_1.field(type => [graphql_1.Int]),
|
|
55
|
-
tslib_1.__metadata("design:type", Array)
|
|
53
|
+
(0, tslib_1.__decorate)([
|
|
54
|
+
(0, graphql_1.field)(type => [graphql_1.Int]),
|
|
55
|
+
(0, tslib_1.__metadata)("design:type", Array)
|
|
56
56
|
], Recipe.prototype, "ratings", void 0);
|
|
57
|
-
tslib_1.__decorate([
|
|
58
|
-
graphql_1.field(),
|
|
59
|
-
repository_1.property(),
|
|
60
|
-
tslib_1.__metadata("design:type", Date)
|
|
57
|
+
(0, tslib_1.__decorate)([
|
|
58
|
+
(0, graphql_1.field)(),
|
|
59
|
+
(0, repository_1.property)(),
|
|
60
|
+
(0, tslib_1.__metadata)("design:type", Date)
|
|
61
61
|
], Recipe.prototype, "creationDate", void 0);
|
|
62
|
-
tslib_1.__decorate([
|
|
63
|
-
graphql_1.field(type => graphql_1.Int),
|
|
64
|
-
tslib_1.__metadata("design:type", Number)
|
|
62
|
+
(0, tslib_1.__decorate)([
|
|
63
|
+
(0, graphql_1.field)(type => graphql_1.Int),
|
|
64
|
+
(0, tslib_1.__metadata)("design:type", Number)
|
|
65
65
|
], Recipe.prototype, "numberInCollection", void 0);
|
|
66
|
-
tslib_1.__decorate([
|
|
67
|
-
graphql_1.field(type => graphql_1.Int),
|
|
68
|
-
tslib_1.__metadata("design:type", Number)
|
|
66
|
+
(0, tslib_1.__decorate)([
|
|
67
|
+
(0, graphql_1.field)(type => graphql_1.Int),
|
|
68
|
+
(0, tslib_1.__metadata)("design:type", Number)
|
|
69
69
|
], Recipe.prototype, "ratingsCount", void 0);
|
|
70
|
-
tslib_1.__decorate([
|
|
71
|
-
graphql_1.field(type => [String]),
|
|
72
|
-
tslib_1.__metadata("design:type", Array)
|
|
70
|
+
(0, tslib_1.__decorate)([
|
|
71
|
+
(0, graphql_1.field)(type => [String]),
|
|
72
|
+
(0, tslib_1.__metadata)("design:type", Array)
|
|
73
73
|
], Recipe.prototype, "ingredients", void 0);
|
|
74
|
-
tslib_1.__decorate([
|
|
75
|
-
graphql_1.field(type => graphql_1.Int),
|
|
76
|
-
tslib_1.__metadata("design:type", Number),
|
|
77
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
74
|
+
(0, tslib_1.__decorate)([
|
|
75
|
+
(0, graphql_1.field)(type => graphql_1.Int),
|
|
76
|
+
(0, tslib_1.__metadata)("design:type", Number),
|
|
77
|
+
(0, tslib_1.__metadata)("design:paramtypes", [])
|
|
78
78
|
], Recipe.prototype, "ingredientsLength", null);
|
|
79
|
-
tslib_1.__decorate([
|
|
80
|
-
graphql_1.field(type => graphql_1.Float, { nullable: true }),
|
|
81
|
-
tslib_1.__metadata("design:type", Object),
|
|
82
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
79
|
+
(0, tslib_1.__decorate)([
|
|
80
|
+
(0, graphql_1.field)(type => graphql_1.Float, { nullable: true }),
|
|
81
|
+
(0, tslib_1.__metadata)("design:type", Object),
|
|
82
|
+
(0, tslib_1.__metadata)("design:paramtypes", [])
|
|
83
83
|
], Recipe.prototype, "averageRating", null);
|
|
84
|
-
Recipe = tslib_1.__decorate([
|
|
85
|
-
graphql_1.objectType({ description: 'Object representing cooking recipe' }),
|
|
86
|
-
repository_1.model({ settings: { strict: false } })
|
|
84
|
+
Recipe = (0, tslib_1.__decorate)([
|
|
85
|
+
(0, graphql_1.objectType)({ description: 'Object representing cooking recipe' }),
|
|
86
|
+
(0, repository_1.model)({ settings: { strict: false } })
|
|
87
87
|
], Recipe);
|
|
88
88
|
exports.Recipe = Recipe;
|
|
89
89
|
//# sourceMappingURL=recipe-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe-type.js","sourceRoot":"","sources":["../../src/graphql-types/recipe-type.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAAoE;AACpE,qDAA6D;AAI7D,IAAa,MAAM,GAAnB,MAAa,MAAO,SAAQ,mBAAM;IAahC,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IA0BD,IAAc,iBAAiB;QAC7B,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;IACjC,CAAC;IAGD,IAAI,aAAa;QACf,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QACzC,IAAI,YAAY,KAAK,CAAC,EAAE;YACtB,OAAO,IAAI,CAAC;SACb;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3D,OAAO,UAAU,GAAG,YAAY,CAAC;IACnC,CAAC;CACF,CAAA;AAnDC;IAFC,eAAK,
|
|
1
|
+
{"version":3,"file":"recipe-type.js","sourceRoot":"","sources":["../../src/graphql-types/recipe-type.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAAoE;AACpE,qDAA6D;AAI7D,IAAa,MAAM,GAAnB,MAAa,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,eAAK,EAAC,IAAI,CAAC,EAAE,CAAC,aAAG,CAAC;;4CACE;AAGrB;IADC,IAAA,eAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;;2CACF;AAGtB;IADC,IAAA,eAAK,EAAC,IAAI,CAAC,EAAE,CAAC,aAAG,CAAC;;;+CAGlB;AAGD;IADC,IAAA,eAAK,EAAC,IAAI,CAAC,EAAE,CAAC,eAAK,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;;2CAQtC;AArDU,MAAM;IAFlB,IAAA,oBAAU,EAAC,EAAC,WAAW,EAAE,oCAAoC,EAAC,CAAC;IAC/D,IAAA,kBAAK,EAAC,EAAC,QAAQ,EAAE,EAAC,MAAM,EAAE,KAAK,EAAC,EAAC,CAAC;GACtB,MAAM,CAsDlB;AAtDY,wBAAM"}
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ const tslib_1 = require("tslib");
|
|
|
8
8
|
// This file is licensed under the MIT License.
|
|
9
9
|
// License text available at https://opensource.org/licenses/MIT
|
|
10
10
|
const application_1 = require("./application");
|
|
11
|
-
tslib_1.__exportStar(require("./application"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./application"), exports);
|
|
12
12
|
async function main(options = {}) {
|
|
13
13
|
const app = new application_1.GraphqlDemoApplication(options);
|
|
14
14
|
await app.boot();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AACA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;AAChE,+CAAwE;AAExE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AACA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;AAChE,+CAAwE;AAExE,6DAA8B;AAEvB,KAAK,UAAU,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|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
|
-
tslib_1.__exportStar(require("./recipe.repository"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./recipe.repository"), exports);
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,mEAAoC"}
|
|
@@ -40,7 +40,7 @@ let RecipeRepository = RecipeRepository_1 = class RecipeRepository extends repos
|
|
|
40
40
|
return recipes.findIndex(r => r.id === recipe.id);
|
|
41
41
|
}
|
|
42
42
|
createRecipe(recipeData) {
|
|
43
|
-
const recipe = class_transformer_1.plainToClass(recipe_type_1.Recipe, recipeData);
|
|
43
|
+
const recipe = (0, class_transformer_1.plainToClass)(recipe_type_1.Recipe, recipeData);
|
|
44
44
|
recipe.id = this.getId();
|
|
45
45
|
recipe.creationDate = new Date('2020-05-24');
|
|
46
46
|
recipe.ratings = [2, 4];
|
|
@@ -51,18 +51,18 @@ let RecipeRepository = RecipeRepository_1 = class RecipeRepository extends repos
|
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
RecipeRepository.idCounter = 0;
|
|
54
|
-
tslib_1.__decorate([
|
|
55
|
-
core_1.inject('recipes'),
|
|
56
|
-
tslib_1.__metadata("design:type", Array)
|
|
54
|
+
(0, tslib_1.__decorate)([
|
|
55
|
+
(0, core_1.inject)('recipes'),
|
|
56
|
+
(0, tslib_1.__metadata)("design:type", Array)
|
|
57
57
|
], RecipeRepository.prototype, "sampleRecipes", void 0);
|
|
58
|
-
RecipeRepository = RecipeRepository_1 = tslib_1.__decorate([
|
|
59
|
-
core_1.injectable({
|
|
58
|
+
RecipeRepository = RecipeRepository_1 = (0, tslib_1.__decorate)([
|
|
59
|
+
(0, core_1.injectable)({
|
|
60
60
|
scope: core_1.BindingScope.SINGLETON,
|
|
61
61
|
tags: { [core_1.ContextTags.NAMESPACE]: repository_1.RepositoryBindings.REPOSITORIES },
|
|
62
62
|
}),
|
|
63
|
-
core_1.lifeCycleObserver('repository'),
|
|
64
|
-
tslib_1.__param(0, core_1.inject('datasources.recipes')),
|
|
65
|
-
tslib_1.__metadata("design:paramtypes", [recipes_datasource_1.RecipesDataSource])
|
|
63
|
+
(0, core_1.lifeCycleObserver)('repository'),
|
|
64
|
+
(0, tslib_1.__param)(0, (0, core_1.inject)('datasources.recipes')),
|
|
65
|
+
(0, tslib_1.__metadata)("design:paramtypes", [recipes_datasource_1.RecipesDataSource])
|
|
66
66
|
], RecipeRepository);
|
|
67
67
|
exports.RecipeRepository = RecipeRepository;
|
|
68
68
|
//# sourceMappingURL=recipe.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe.repository.js","sourceRoot":"","sources":["../../src/repositories/recipe.repository.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;;AAEhE,yCAOwB;AACxB,qDAA+E;AAC/E,yDAA+C;AAC/C,0EAAoE;AAEpE,8DAAoD;AAOpD,IAAa,gBAAgB,wBAA7B,MAAa,gBACX,SAAQ,kCAA6D;IAQrE,YAA2C,UAA6B;QACtE,KAAK,CAAC,oBAAM,EAAE,UAAU,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,+CAA+C;QAC/C,kBAAgB,CAAC,SAAS,IAAI,IAAI,CAAC,aAAa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C;;uDACc;AAPrB,gBAAgB;IAL5B,IAAA,iBAAU,EAAC;QACV,KAAK,EAAE,mBAAY,CAAC,SAAS;QAC7B,IAAI,EAAE,EAAC,CAAC,kBAAW,CAAC,SAAS,CAAC,EAAE,+BAAkB,CAAC,YAAY,EAAC;KACjE,CAAC;IACD,IAAA,wBAAiB,EAAC,YAAY,CAAC;IAUjB,wBAAA,IAAA,aAAM,EAAC,qBAAqB,CAAC,CAAA;kDAAa,sCAAiB;GAT7D,gBAAgB,CAqD5B;AArDY,4CAAgB"}
|
package/dist/sample-recipes.js
CHANGED
|
@@ -33,6 +33,6 @@ exports.sampleRecipes = [
|
|
|
33
33
|
}),
|
|
34
34
|
];
|
|
35
35
|
function createRecipe(recipeData) {
|
|
36
|
-
return class_transformer_1.plainToClass(recipe_type_1.Recipe, recipeData);
|
|
36
|
+
return (0, class_transformer_1.plainToClass)(recipe_type_1.Recipe, recipeData);
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=sample-recipes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sample-recipes.js","sourceRoot":"","sources":["../src/sample-recipes.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,yDAA+C;AAC/C,6DAAmD;AAEtC,QAAA,aAAa,GAAG;IAC3B,YAAY,CAAC;QACX,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC;QACpC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAClB,YAAY,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;KACrC,CAAC;IACF,YAAY,CAAC;QACX,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,CAAC,MAAM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E,EAAE,GAAG;QACP,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;QACvC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACf,YAAY,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;KACrC,CAAC;CACH,CAAC;AAEF,SAAS,YAAY,CAAC,UAA2B;IAC/C,OAAO,IAAA,gCAAY,EAAC,oBAAM,EAAE,UAAU,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -13,8 +13,8 @@ let RecipeService = RecipeService_1 = class RecipeService {
|
|
|
13
13
|
return recipe.ratings.filter(rating => rating >= minRate).length;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
RecipeService = RecipeService_1 = tslib_1.__decorate([
|
|
17
|
-
core_1.injectable(core_1.asService(RecipeService_1))
|
|
16
|
+
RecipeService = RecipeService_1 = (0, tslib_1.__decorate)([
|
|
17
|
+
(0, core_1.injectable)((0, core_1.asService)(RecipeService_1))
|
|
18
18
|
], RecipeService);
|
|
19
19
|
exports.RecipeService = RecipeService;
|
|
20
20
|
//# sourceMappingURL=recipe.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe.service.js","sourceRoot":"","sources":["../../src/services/recipe.service.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;;AAEhE,yCAAqD;AAIrD,IAAa,aAAa,qBAA1B,MAAa,aAAa;IACxB,YAAY,CAAC,MAAc,EAAE,OAAe;QAC1C,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,MAAM,CAAC;IACnE,CAAC;CACF,CAAA;AAJY,aAAa;IADzB,iBAAU,
|
|
1
|
+
{"version":3,"file":"recipe.service.js","sourceRoot":"","sources":["../../src/services/recipe.service.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yCAAyC;AACzC,+CAA+C;AAC/C,gEAAgE;;;;;AAEhE,yCAAqD;AAIrD,IAAa,aAAa,qBAA1B,MAAa,aAAa;IACxB,YAAY,CAAC,MAAc,EAAE,OAAe;QAC1C,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,MAAM,CAAC;IACnE,CAAC;CACF,CAAA;AAJY,aAAa;IADzB,IAAA,iBAAU,EAAC,IAAA,gBAAS,EAAC,eAAa,CAAC,CAAC;GACxB,aAAa,CAIzB;AAJY,sCAAa"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/example-graphql",
|
|
3
3
|
"description": "GraphQL Example Application",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"loopback-application",
|
|
7
7
|
"loopback"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"directory": "examples/graphql"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": "
|
|
20
|
+
"node": "12 || 14 || 16 || 17"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"acceptance": "lb-mocha \"dist/__tests__/acceptance/**/*.js\"",
|
|
@@ -49,24 +49,24 @@
|
|
|
49
49
|
"!*/__tests__"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@loopback/boot": "^
|
|
53
|
-
"@loopback/core": "^
|
|
54
|
-
"@loopback/graphql": "^0.
|
|
55
|
-
"@loopback/repository": "^
|
|
56
|
-
"@loopback/rest": "^
|
|
57
|
-
"class-transformer": "^0.
|
|
52
|
+
"@loopback/boot": "^4.1.0",
|
|
53
|
+
"@loopback/core": "^3.1.0",
|
|
54
|
+
"@loopback/graphql": "^0.7.0",
|
|
55
|
+
"@loopback/repository": "^4.1.0",
|
|
56
|
+
"@loopback/rest": "^11.1.0",
|
|
57
|
+
"class-transformer": "^0.5.1",
|
|
58
58
|
"tslib": "^2.3.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@loopback/build": "^
|
|
62
|
-
"@loopback/eslint-config": "^
|
|
63
|
-
"@loopback/testlab": "^
|
|
61
|
+
"@loopback/build": "^8.1.0",
|
|
62
|
+
"@loopback/eslint-config": "^12.0.2",
|
|
63
|
+
"@loopback/testlab": "^4.1.0",
|
|
64
64
|
"@types/multer": "^1.4.7",
|
|
65
|
-
"@types/node": "^
|
|
66
|
-
"eslint": "^
|
|
65
|
+
"@types/node": "^12.20.43",
|
|
66
|
+
"eslint": "^8.8.0",
|
|
67
67
|
"rimraf": "^3.0.2",
|
|
68
|
-
"source-map-support": "^0.5.
|
|
69
|
-
"typescript": "~4.
|
|
68
|
+
"source-map-support": "^0.5.21",
|
|
69
|
+
"typescript": "~4.5.5"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "e16818ccb01edc0269ef6c45b022c5f1b67f852c"
|
|
72
72
|
}
|
package/src/application.ts
CHANGED
|
@@ -20,7 +20,14 @@ export class GraphqlDemoApplication extends BootMixin(
|
|
|
20
20
|
super(options);
|
|
21
21
|
|
|
22
22
|
this.component(GraphQLComponent);
|
|
23
|
+
|
|
23
24
|
const server = this.getSync(GraphQLBindings.GRAPHQL_SERVER);
|
|
25
|
+
// To register one or more middlewares as per https://typegraphql.com/docs/middlewares.html
|
|
26
|
+
server.middleware((resolverData, next) => {
|
|
27
|
+
// It's invoked for each field resolver, query and mutation operations
|
|
28
|
+
return next();
|
|
29
|
+
});
|
|
30
|
+
|
|
24
31
|
this.expressMiddleware('middleware.express.GraphQL', server.expressApp);
|
|
25
32
|
|
|
26
33
|
// It's possible to register a graphql context resolver
|