@nestjs/apollo 13.0.0 → 13.0.2

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":"apollo-base.driver.d.ts","sourceRoot":"","sources":["../../lib/drivers/apollo-base.driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAYhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAUnD,8BAAsB,gBAAgB,CACpC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAClD,SAAQ,qBAAqB,CAAC,CAAC,CAAC;IAChC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAElD,IAAI,QAAQ,IAAI,YAAY,CAAC,WAAW,CAAC,CAExC;IAEY,KAAK,CAAC,aAAa,EAAE,CAAC;IAa5B,IAAI;IAIE,mBAAmB,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IA6CjD,sBAAsB,CAC3B,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,CACR,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,GAAG,KACT,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAC/B,sBAAsB,EAAE,QAAQ,IAExB,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,4EAE1C,GAAG;cAMQ,eAAe,CAC7B,OAAO,EAAE,CAAC,EACV,EAAE,YAAY,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;cAkCtC,eAAe,CAC7B,OAAO,EAAE,CAAC,EACV,EAAE,YAAY,EAAE,GAAE;QAAE,YAAY,CAAC,EAAE,MAA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YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;IAuCtD,OAAO,CAAC,iBAAiB;IAuBzB,OAAO,CAAC,0BAA0B;IA0ClC,OAAO,CAAC,mBAAmB;IA8B3B,OAAO,CAAC,iBAAiB;CAgB1B"}
@@ -77,6 +77,15 @@ class ApolloBaseDriver extends graphql_1.AbstractGraphQLDriver {
77
77
  async registerExpress(options, { preStartHook } = {}) {
78
78
  const { path, typeDefs, resolvers, schema } = options;
79
79
  const httpAdapter = this.httpAdapterHost.httpAdapter;
80
+ // Workaround: GraphQL playground requires body to be present
81
+ // otherwise, it shows the "req.body is not set; this probably means you forgot to set up the json middleware before the Apollo Server middleware." error.
82
+ // The latest version of "body-parser" does not set the body if there is no payload.
83
+ // @see https://github.com/nestjs/graphql/issues/3451
84
+ // @see https://github.com/nestjs/nest/pull/14443
85
+ httpAdapter.use(path, (req, _, next) => {
86
+ req.body = req.body ?? {};
87
+ next();
88
+ });
80
89
  const app = httpAdapter.getInstance();
81
90
  const drainHttpServerPlugin = (0, drainHttpServer_1.ApolloServerPluginDrainHttpServer)({
82
91
  httpServer: httpAdapter.getHttpServer(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/apollo",
3
- "version": "13.0.0",
3
+ "version": "13.0.2",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@apollo)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -27,11 +27,11 @@
27
27
  "@apollo/server-plugin-response-cache": "4.1.4",
28
28
  "@apollo/subgraph": "2.2.3",
29
29
  "@as-integrations/fastify": "2.1.1",
30
- "@nestjs/common": "11.0.1",
31
- "@nestjs/core": "11.0.1",
32
- "@nestjs/platform-express": "11.0.1",
33
- "@nestjs/platform-fastify": "11.0.1",
34
- "@nestjs/testing": "11.0.1",
30
+ "@nestjs/common": "11.0.3",
31
+ "@nestjs/core": "11.0.3",
32
+ "@nestjs/platform-express": "11.0.3",
33
+ "@nestjs/platform-fastify": "11.0.3",
34
+ "@nestjs/testing": "11.0.3",
35
35
  "apollo-cache-inmemory": "1.6.6",
36
36
  "apollo-client": "2.6.10",
37
37
  "apollo-link-ws": "1.0.20"
@@ -49,7 +49,7 @@
49
49
  "@as-integrations/fastify": "^2.1.1",
50
50
  "@nestjs/common": "^11.0.1",
51
51
  "@nestjs/core": "^11.0.1",
52
- "@nestjs/graphql": "^12.2.2",
52
+ "@nestjs/graphql": "^13.0.0",
53
53
  "graphql": "^16.10.0"
54
54
  },
55
55
  "peerDependenciesMeta": {
@@ -63,5 +63,5 @@
63
63
  "optional": true
64
64
  }
65
65
  },
66
- "gitHead": "82d28fc500e017cbbc34c1c184c3b55c370e7d89"
66
+ "gitHead": "822f07316fc4776ddd38d04c1bdeb63756139576"
67
67
  }