@ldsg/graphql 0.3.10 → 0.3.17

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 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,OAAO,EAGL,+BAA+B,EAEhC,MAAM,SAAS,CAAC;AAEjB,qBAAa,eAAgB,SAAQ,QAAQ,CAAC,+BAA+B,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB,CAiBhC;IAEF,gBAAgB;;MA0Dd;CACH"}
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,OAAO,EAGL,+BAA+B,EAEhC,MAAM,SAAS,CAAC;AAEjB,qBAAa,eAAgB,SAAQ,QAAQ,CAAC,+BAA+B,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB,CAiBhC;IAEF,gBAAgB;;MA2Dd;CACH"}
package/dist/resource.js CHANGED
@@ -24,24 +24,26 @@ class GraphqlResource extends resource_1.Resource {
24
24
  this.getGraphQLSchema = () => {
25
25
  const schemaComposer = new graphql_compose_1.SchemaComposer();
26
26
  const { id, parentId, getFilteredResources } = this;
27
- const {
28
- /**
29
- * 同级资源
30
- */
31
- resources: peerResources } = getFilteredResources({
27
+ const { resources: peerResources } = getFilteredResources({
32
28
  parentId
33
29
  });
34
- peerResources.forEach((resource) => {
30
+ peerResources
31
+ .filter((resource) => resource.kind !== 'graphql-resolvers')
32
+ .forEach((resource) => {
35
33
  var _a;
36
34
  (_a = resource.modifyGraphQLSchema) === null || _a === void 0 ? void 0 : _a.call(resource, {
37
35
  schemaComposer
38
36
  });
39
37
  });
40
- const {
41
- /**
42
- * 子级资源
43
- */
44
- resources: childResources } = getFilteredResources({
38
+ peerResources
39
+ .filter((resource) => resource.kind === 'graphql-resolvers')
40
+ .forEach((resource) => {
41
+ var _a;
42
+ (_a = resource.modifyGraphQLSchema) === null || _a === void 0 ? void 0 : _a.call(resource, {
43
+ schemaComposer
44
+ });
45
+ });
46
+ const { resources: childResources } = getFilteredResources({
45
47
  parentId: id
46
48
  });
47
49
  const graphqlMiddlewareInfos = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldsg/graphql",
3
- "version": "0.3.10",
3
+ "version": "0.3.17",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -15,9 +15,9 @@
15
15
  "graphql-compose": "^9.1.0",
16
16
  "graphql-middleware": "^6.1.35",
17
17
  "graphql-yoga": "^5.13.4",
18
- "@ldsg/handler": "0.3.10",
19
- "@ldsg/resource-definition": "0.3.10",
20
- "@ldsg/resource": "0.3.10"
18
+ "@ldsg/handler": "0.3.17",
19
+ "@ldsg/resource": "0.3.17",
20
+ "@ldsg/resource-definition": "0.3.17"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/jest": "^29.5.2",
@@ -27,14 +27,15 @@
27
27
  "ts-jest": "^29.1.5",
28
28
  "ts-node": "^10.9.2",
29
29
  "typescript": "^5.8.3",
30
- "@ldsg/application": "0.3.10",
31
- "@ldsg/types": "0.3.10"
30
+ "@ldsg/application": "0.3.17",
31
+ "@ldsg/types": "0.3.17"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsc --project tsconfig.build.json",
38
- "clean": "rm -rf dist"
38
+ "clean": "rm -rf dist",
39
+ "test": "jest"
39
40
  }
40
41
  }