@ldsg/graphql 0.3.28 → 0.3.30

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;;MAoEd;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;AAEjB,qBAAa,eAAgB,SAAQ,QAAQ,CAAC,+BAA+B,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB,CAiBhC;IAEF,gBAAgB;;MA2Ed;CACH"}
package/dist/resource.js CHANGED
@@ -5,6 +5,7 @@ const resource_1 = require("@ldsg/resource");
5
5
  const graphql_1 = require("graphql");
6
6
  const graphql_compose_1 = require("graphql-compose");
7
7
  const graphql_middleware_1 = require("graphql-middleware");
8
+ const graphql_scalars_1 = require("graphql-scalars");
8
9
  const graphql_yoga_1 = require("graphql-yoga");
9
10
  const constants_1 = require("./constants");
10
11
  class GraphqlResource extends resource_1.Resource {
@@ -23,6 +24,12 @@ class GraphqlResource extends resource_1.Resource {
23
24
  };
24
25
  this.getGraphQLSchema = () => {
25
26
  const schemaComposer = new graphql_compose_1.SchemaComposer();
27
+ /**
28
+ * 添加 graphql-scalars 中的所有标量
29
+ */
30
+ Object.values(graphql_scalars_1.resolvers).forEach((scalar) => {
31
+ schemaComposer.add(graphql_compose_1.ScalarTypeComposer.create(scalar, schemaComposer));
32
+ });
26
33
  const { id, parentId, getFilteredResources } = this;
27
34
  const { resources: peerResources } = getFilteredResources({
28
35
  parentId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldsg/graphql",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -14,11 +14,12 @@
14
14
  "graphql": "16.11.0",
15
15
  "graphql-compose": "^9.1.0",
16
16
  "graphql-middleware": "^6.1.35",
17
+ "graphql-scalars": "^1.25.0",
17
18
  "graphql-yoga": "^5.13.4",
18
19
  "zod": "^4.1.11",
19
- "@ldsg/handler": "0.3.28",
20
- "@ldsg/resource-definition": "0.3.28",
21
- "@ldsg/resource": "0.3.28"
20
+ "@ldsg/handler": "0.3.30",
21
+ "@ldsg/resource-definition": "0.3.30",
22
+ "@ldsg/resource": "0.3.30"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@types/jest": "^29.5.2",
@@ -28,8 +29,8 @@
28
29
  "ts-jest": "^29.1.5",
29
30
  "ts-node": "^10.9.2",
30
31
  "typescript": "^5.8.3",
31
- "@ldsg/application": "0.3.28",
32
- "@ldsg/types": "0.3.28"
32
+ "@ldsg/application": "0.3.30",
33
+ "@ldsg/types": "0.3.30"
33
34
  },
34
35
  "publishConfig": {
35
36
  "access": "public"