@orion-js/graphql 3.4.7 → 3.4.9
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/lib/startGraphQL.js +13 -12
- package/package.json +7 -7
package/lib/startGraphQL.js
CHANGED
|
@@ -10,7 +10,6 @@ const http_1 = require("@orion-js/http");
|
|
|
10
10
|
const server_1 = require("@apollo/server");
|
|
11
11
|
const express4_1 = require("@apollo/server/express4");
|
|
12
12
|
const drainHttpServer_1 = require("@apollo/server/plugin/drainHttpServer");
|
|
13
|
-
const http_2 = require("@orion-js/http");
|
|
14
13
|
async function default_1(options) {
|
|
15
14
|
const apolloOptions = await (0, getApolloOptions_1.default)(options);
|
|
16
15
|
const app = options.app || (0, http_1.getApp)();
|
|
@@ -25,17 +24,19 @@ async function default_1(options) {
|
|
|
25
24
|
plugins: [...(apolloOptions.plugins || []), ...drainPlugins, ...subPlugins]
|
|
26
25
|
});
|
|
27
26
|
await server.start();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
const middleware = (0, express4_1.expressMiddleware)(server, {
|
|
28
|
+
// @ts-expect-error
|
|
29
|
+
context: ({ req, res }) => req._viewer
|
|
30
|
+
});
|
|
31
|
+
(0, http_1.registerRoute)((0, http_1.route)({
|
|
32
|
+
app,
|
|
33
|
+
method: 'all',
|
|
34
|
+
path: '/graphql',
|
|
35
|
+
bodyParser: 'json',
|
|
36
|
+
async resolve(req, res, viewer) {
|
|
37
|
+
// @ts-expect-error
|
|
38
|
+
req._viewer = viewer;
|
|
39
|
+
return middleware(req, res, req.next);
|
|
39
40
|
}
|
|
40
41
|
}));
|
|
41
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/graphql",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.9",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"author": "nicolaslopezj",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"@graphql-tools/schema": "^9.0.12",
|
|
18
18
|
"@orion-js/env": "^3.4.1",
|
|
19
19
|
"@orion-js/helpers": "^3.4.1",
|
|
20
|
-
"@orion-js/http": "^3.4.
|
|
21
|
-
"@orion-js/models": "^3.4.
|
|
22
|
-
"@orion-js/resolvers": "^3.4.
|
|
23
|
-
"@orion-js/schema": "^3.4.
|
|
20
|
+
"@orion-js/http": "^3.4.9",
|
|
21
|
+
"@orion-js/models": "^3.4.9",
|
|
22
|
+
"@orion-js/resolvers": "^3.4.9",
|
|
23
|
+
"@orion-js/schema": "^3.4.9",
|
|
24
24
|
"@orion-js/services": "^3.4.1",
|
|
25
|
-
"@orion-js/typed-model": "^3.4.
|
|
25
|
+
"@orion-js/typed-model": "^3.4.9",
|
|
26
26
|
"graphql-iso-date": "^3.6.1",
|
|
27
27
|
"graphql-subscriptions": "2.0.0",
|
|
28
28
|
"graphql-ws": "^5.11.2",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "e9c223e70752b6c613f58e63f8fd9fab471618de"
|
|
55
55
|
}
|