@ldsg/graphql 0.3.10 → 0.3.11
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/resource.d.ts.map +1 -1
- package/dist/resource.js +13 -11
- package/package.json +5 -4
package/dist/resource.d.ts.map
CHANGED
|
@@ -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;;
|
|
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
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"graphql-middleware": "^6.1.35",
|
|
17
17
|
"graphql-yoga": "^5.13.4",
|
|
18
18
|
"@ldsg/handler": "0.3.10",
|
|
19
|
-
"@ldsg/resource
|
|
20
|
-
"@ldsg/resource": "0.3.10"
|
|
19
|
+
"@ldsg/resource": "0.3.10",
|
|
20
|
+
"@ldsg/resource-definition": "0.3.10"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/jest": "^29.5.2",
|
|
@@ -35,6 +35,7 @@
|
|
|
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
|
}
|