@campxdev/server-shared 1.9.8-alpha.4 → 1.9.8-alpha.6
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":"graphql-middleware.d.ts","sourceRoot":"","sources":["../../src/request-store/graphql-middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql-middleware.d.ts","sourceRoot":"","sources":["../../src/request-store/graphql-middleware.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS;IAAE,GAAG,EAAE,GAAG,CAAA;CAAE,qBAe7D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GAAI,SAAS;IAAE,GAAG,EAAE,GAAG,CAAA;CAAE;;CAWjE,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.graphqlContextMiddlewareSync = exports.graphqlContextMiddleware = void 0;
|
|
4
4
|
const graphql_context_1 = require("./contexts/graphql-context");
|
|
5
|
+
const express_context_1 = require("./contexts/express-context");
|
|
5
6
|
const store_config_1 = require("./store-config");
|
|
6
7
|
/**
|
|
7
8
|
* GraphQL context middleware that integrates with the existing AsyncLocalStorage store.
|
|
@@ -24,8 +25,9 @@ const graphqlContextMiddleware = ({ req }) => {
|
|
|
24
25
|
// Run the GraphQL context within the store
|
|
25
26
|
return new Promise((resolve) => {
|
|
26
27
|
store_config_1.store.run(currentStore, () => {
|
|
27
|
-
// Set
|
|
28
|
+
// Set both GraphQL and Express request in the AsyncLocalStorage store
|
|
28
29
|
(0, graphql_context_1.setGraphQLRequest)(req);
|
|
30
|
+
(0, express_context_1.setExpressRequest)(req);
|
|
29
31
|
// Return the context with the request
|
|
30
32
|
resolve({ req });
|
|
31
33
|
});
|
|
@@ -42,11 +44,10 @@ exports.graphqlContextMiddleware = graphqlContextMiddleware;
|
|
|
42
44
|
const graphqlContextMiddlewareSync = ({ req }) => {
|
|
43
45
|
// Get the current store or create a new one
|
|
44
46
|
const currentStore = store_config_1.store.getStore() || new Map();
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
47
|
+
// Set both the GraphQL request and Express request in the store synchronously
|
|
48
|
+
// This ensures session management methods can access the request
|
|
49
|
+
(0, graphql_context_1.setGraphQLRequest)(req);
|
|
50
|
+
(0, express_context_1.setExpressRequest)(req);
|
|
50
51
|
// Return the context with the request
|
|
51
52
|
return { req };
|
|
52
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-middleware.js","sourceRoot":"","sources":["../../src/request-store/graphql-middleware.ts"],"names":[],"mappings":";;;AAAA,gEAA+D;AAC/D,iDAAuC;AAEvC;;;;;;;;;;;;;;GAcG;AACI,MAAM,wBAAwB,GAAG,CAAC,EAAE,GAAG,EAAgB,EAAE,EAAE;IAChE,4CAA4C;IAC5C,MAAM,YAAY,GAAG,oBAAK,CAAC,QAAQ,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC;IAEnD,2CAA2C;IAC3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,oBAAK,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,EAAE;YAC3B,
|
|
1
|
+
{"version":3,"file":"graphql-middleware.js","sourceRoot":"","sources":["../../src/request-store/graphql-middleware.ts"],"names":[],"mappings":";;;AAAA,gEAA+D;AAC/D,gEAA+D;AAC/D,iDAAuC;AAEvC;;;;;;;;;;;;;;GAcG;AACI,MAAM,wBAAwB,GAAG,CAAC,EAAE,GAAG,EAAgB,EAAE,EAAE;IAChE,4CAA4C;IAC5C,MAAM,YAAY,GAAG,oBAAK,CAAC,QAAQ,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC;IAEnD,2CAA2C;IAC3C,OAAO,IAAI,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