@ldsg/graphql 0.3.37 → 0.3.40

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.
@@ -12,6 +12,7 @@ test("e2e", async () => {
12
12
  kind: "application",
13
13
  parentId: "ROOT",
14
14
  settings: {
15
+ slug: "application",
15
16
  title: "应用",
16
17
  description: "应用根资源",
17
18
  name: "测试应用",
@@ -22,6 +23,7 @@ test("e2e", async () => {
22
23
  kind: "graphql",
23
24
  parentId: "application",
24
25
  settings: {
26
+ slug: "graphql",
25
27
  title: "",
26
28
  description: "",
27
29
  graphqlEndpoint: "/test-graphql",
@@ -9,6 +9,7 @@ test("unit", () => {
9
9
  kind: "graphql",
10
10
  parentId: "test-application",
11
11
  settings: {
12
+ slug: "test-graphql",
12
13
  title: "",
13
14
  description: "",
14
15
  graphqlEndpoint: "/test-graphql",
@@ -47,6 +48,7 @@ test("unit", () => {
47
48
  kind: "a",
48
49
  parentId: "test-application",
49
50
  settings: {
51
+ slug: "test-a",
50
52
  title: "",
51
53
  description: "",
52
54
  },
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,sDAAsD,EAAE,uBAGpE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uDAAuD,EAAE,+BAQnE,CAAC;AAEJ,eAAO,MAAM,6CAA6C,EAAE,uBAG3D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0CAG1D,CAAC;AAEJ,eAAO,MAAM,wBAAwB,aAAa,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,sDAAsD,EAAE,uBAIpE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uDAAuD,EAAE,+BAQnE,CAAC;AAEJ,eAAO,MAAM,6CAA6C,EAAE,uBAI3D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0CAG1D,CAAC;AAEJ,eAAO,MAAM,wBAAwB,aAAa,CAAC"}
package/dist/constants.js CHANGED
@@ -6,6 +6,7 @@ exports.DEFAULT_GRAPHQL_ENDPOINT = exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE
6
6
  * 实例化资源处理程序普通资源配置
7
7
  */
8
8
  exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
9
+ slug: "graphql-instantiate-resource-handler",
9
10
  title: "GraphQL实例化资源处理程序",
10
11
  description: "",
11
12
  };
@@ -23,6 +24,7 @@ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
23
24
  ],
24
25
  };
25
26
  exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
27
+ slug: "graphql-resource-definition",
26
28
  title: "GraphQL资源定义",
27
29
  description: "",
28
30
  };
@@ -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;AAO1C,OAAO,EAGL,+BAA+B,EAEhC,MAAM,SAAS,CAAC;AAEjB,qBAAa,eAAgB,SAAQ,QAAQ,CAAC,+BAA+B,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB,CAiBhC;IAEF,gBAAgB;;MA2Ed;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;AAO1C,OAAO,EAGL,+BAA+B,EAEhC,MAAM,SAAS,CAAC;AAIjB,qBAAa,eAAgB,SAAQ,QAAQ,CAAC,+BAA+B,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB,CAiBhC;IAEF,gBAAgB;;MA6Ed;CACH"}
package/dist/resource.js CHANGED
@@ -8,6 +8,7 @@ const graphql_middleware_1 = require("graphql-middleware");
8
8
  const graphql_scalars_1 = require("graphql-scalars");
9
9
  const graphql_yoga_1 = require("graphql-yoga");
10
10
  const constants_1 = require("./constants");
11
+ const IGNORE_SCALAR_LIST = ["Date"];
11
12
  class GraphqlResource extends resource_1.Resource {
12
13
  constructor() {
13
14
  super(...arguments);
@@ -25,10 +26,12 @@ class GraphqlResource extends resource_1.Resource {
25
26
  this.getGraphQLSchema = () => {
26
27
  const schemaComposer = new graphql_compose_1.SchemaComposer();
27
28
  /**
28
- * 添加 graphql-scalars 中的所有标量
29
+ * 补充 graphql-scalars 中的所有标量(已存在的标量不覆盖)
29
30
  */
30
31
  Object.values(graphql_scalars_1.resolvers).forEach((scalar) => {
31
- schemaComposer.add(graphql_compose_1.ScalarTypeComposer.create(scalar, schemaComposer));
32
+ if (!IGNORE_SCALAR_LIST.includes(scalar.name)) {
33
+ schemaComposer.add(graphql_compose_1.ScalarTypeComposer.create(scalar, schemaComposer));
34
+ }
32
35
  });
33
36
  const { id, parentId, getFilteredResources } = this;
34
37
  const { resources: peerResources } = getFilteredResources({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldsg/graphql",
3
- "version": "0.3.37",
3
+ "version": "0.3.40",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -20,11 +20,11 @@
20
20
  "graphql-scalars": "^1.25.0",
21
21
  "graphql-yoga": "^5.13.4",
22
22
  "zod": "^4.1.11",
23
- "@ldsg/application": "0.3.37",
24
- "@ldsg/handler": "0.3.37",
25
- "@ldsg/resource": "0.3.37",
26
- "@ldsg/types": "0.3.37",
27
- "@ldsg/resource-definition": "0.3.37"
23
+ "@ldsg/application": "0.3.40",
24
+ "@ldsg/handler": "0.3.40",
25
+ "@ldsg/resource": "0.3.40",
26
+ "@ldsg/resource-definition": "0.3.40",
27
+ "@ldsg/types": "0.3.40"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/jest": "^29.5.2",