@steedos/service-api 2.5.0-beta.1 → 2.5.0-beta.3

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.
Files changed (2) hide show
  1. package/index.js +53 -4
  2. package/package.json +6 -6
package/index.js CHANGED
@@ -417,10 +417,6 @@ module.exports = {
417
417
  schemaDirectives = _.cloneDeep(mixinOptions.schemaDirectives);
418
418
  }
419
419
 
420
- if (this.globalTypeDefs) {
421
- typeDefs = typeDefs.concat(this.globalTypeDefs);
422
- }
423
-
424
420
  let queries = [];
425
421
  let mutations = [];
426
422
  let subscriptions = [];
@@ -430,6 +426,59 @@ module.exports = {
430
426
  let enums = [];
431
427
  let inputs = [];
432
428
 
429
+ if (this.globalGraphQLSettings) {
430
+ if (_.isObject(this.globalGraphQLSettings)) {
431
+ const globalDef = this.globalGraphQLSettings;
432
+ const thisServiceName = this.name;
433
+ // console.log('thisServiceName', thisServiceName)
434
+
435
+ if (globalDef.query) {
436
+ queries = queries.concat(globalDef.query);
437
+ }
438
+
439
+ if (globalDef.mutation) {
440
+ mutations = mutations.concat(globalDef.mutation);
441
+ }
442
+
443
+ if (globalDef.subscription) {
444
+ subscriptions = subscriptions.concat(globalDef.subscription);
445
+ }
446
+
447
+ if (globalDef.type) {
448
+ types = types.concat(globalDef.type);
449
+ }
450
+
451
+ if (globalDef.interface) {
452
+ interfaces = interfaces.concat(globalDef.interface);
453
+ }
454
+
455
+ if (globalDef.union) {
456
+ unions = unions.concat(globalDef.union);
457
+ }
458
+
459
+ if (globalDef.enum) {
460
+ enums = enums.concat(globalDef.enum);
461
+ }
462
+
463
+ if (globalDef.input) {
464
+ inputs = inputs.concat(globalDef.input);
465
+ }
466
+
467
+ if (globalDef.resolvers) {
468
+ resolvers = Object.entries(globalDef.resolvers).reduce(
469
+ (acc, [name, resolver]) => {
470
+ acc[name] = _.merge(
471
+ acc[name] || {},
472
+ this.createServiceResolvers(thisServiceName, resolver)
473
+ );
474
+ return acc;
475
+ },
476
+ resolvers
477
+ );
478
+ }
479
+ }
480
+ }
481
+
433
482
  const processedServices = new Set();
434
483
 
435
484
  services.forEach(service => {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@steedos/service-api",
3
- "version": "2.5.0-beta.1",
3
+ "version": "2.5.0-beta.3",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
- "@steedos/auth": "2.5.0-beta.1",
8
- "@steedos/router": "2.5.0-beta.1",
9
- "@steedos/service-object-graphql": "2.5.0-beta.1",
10
- "@steedos/service-ui": "2.5.0-beta.1",
7
+ "@steedos/auth": "2.5.0-beta.3",
8
+ "@steedos/router": "2.5.0-beta.3",
9
+ "@steedos/service-object-graphql": "2.5.0-beta.3",
10
+ "@steedos/service-ui": "2.5.0-beta.3",
11
11
  "graphql": "^15.8.0",
12
12
  "graphql-iso-date": "^3.6.1",
13
13
  "graphql-type-json": "^0.3.2",
@@ -19,5 +19,5 @@
19
19
  "publishConfig": {
20
20
  "access": "public"
21
21
  },
22
- "gitHead": "5da093d78baa6f2d7011348060c30671354cc7f0"
22
+ "gitHead": "48546b91b2a44dd6f6673af7f5ab707faff6e07c"
23
23
  }