@aleleba/create-node-ts-graphql-server 1.4.3 → 1.5.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleleba/create-node-ts-graphql-server",
3
- "version": "1.4.3",
3
+ "version": "1.5.0",
4
4
  "description": "Node with Typescript and GraphQL Server",
5
5
  "bin": "./bin/cli.js",
6
6
  "main": "index.js",
@@ -36,12 +36,13 @@
36
36
  "@graphql-tools/schema": "^9.0.17",
37
37
  "body-parser": "^1.20.2",
38
38
  "class-validator": "^0.14.0",
39
+ "cookie-parse": "^0.4.0",
39
40
  "cookie-parser": "^1.4.6",
40
41
  "cors": "^2.8.5",
41
42
  "dotenv": "^16.0.3",
42
43
  "express": "^4.18.2",
43
44
  "graphql": "^16.6.0",
44
- "graphql-http": "^1.16.0",
45
+ "graphql-http": "^1.17.0",
45
46
  "graphql-playground-middleware-express": "^1.7.23",
46
47
  "graphql-subscriptions": "^2.0.0",
47
48
  "graphql-tools": "^8.3.19",
@@ -61,13 +62,13 @@
61
62
  "@types/cors": "^2.8.13",
62
63
  "@types/express": "^4.17.17",
63
64
  "@types/jest": "^29.5.0",
64
- "@types/node": "^18.15.5",
65
+ "@types/node": "^18.15.10",
65
66
  "@types/supertest": "^2.0.12",
66
- "@types/webpack": "^5.28.0",
67
+ "@types/webpack": "^5.28.1",
67
68
  "@types/webpack-node-externals": "^3.0.0",
68
69
  "@types/ws": "^8.5.4",
69
- "@typescript-eslint/eslint-plugin": "^5.56.0",
70
- "@typescript-eslint/parser": "^5.56.0",
70
+ "@typescript-eslint/eslint-plugin": "^5.57.0",
71
+ "@typescript-eslint/parser": "^5.57.0",
71
72
  "babel-loader": "^9.1.2",
72
73
  "clean-webpack-plugin": "^4.0.0",
73
74
  "compression-webpack-plugin": "^10.0.0",
@@ -2,4 +2,9 @@
2
2
  declare module "*.gql" {
3
3
  const content: any;
4
4
  export default content;
5
+ }
6
+
7
+ declare module 'cookie-parse' {
8
+ const content: any;
9
+ export default content;
5
10
  }
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  import express from 'express'; //express
4
- // import { graphqlHTTP } from 'express-graphql';
5
4
  import { createHandler } from 'graphql-http/lib/use/express';
6
5
  import schema from '@src/GraphQL/schema';
7
6
 
@@ -12,7 +11,10 @@ server.use(
12
11
  '/',
13
12
  createHandler({
14
13
  schema,
15
- context: (req, res) => ({ req, res })
14
+ context(req) {
15
+ const res = req.context.res
16
+ return {req, res};
17
+ },
16
18
  })
17
19
  );
18
20