@envelop/graphql-middleware 3.4.0-alpha-e9434aa.0 → 3.4.0-alpha-05dbec7.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/esm/index.js +3 -7
- package/package.json +2 -2
package/esm/index.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useGraphQLMiddleware = void 0;
|
|
4
|
-
const graphql_middleware_1 = require("graphql-middleware");
|
|
1
|
+
import { applyMiddleware } from 'graphql-middleware';
|
|
5
2
|
const graphqlMiddlewareAppliedTransformSymbol = Symbol('graphqlMiddleware.appliedTransform');
|
|
6
|
-
const useGraphQLMiddleware = (middlewares) => {
|
|
3
|
+
export const useGraphQLMiddleware = (middlewares) => {
|
|
7
4
|
return {
|
|
8
5
|
onSchemaChange({ schema, replaceSchema }) {
|
|
9
6
|
var _a;
|
|
@@ -12,7 +9,7 @@ const useGraphQLMiddleware = (middlewares) => {
|
|
|
12
9
|
return;
|
|
13
10
|
}
|
|
14
11
|
if (middlewares.length > 0) {
|
|
15
|
-
const wrappedSchema =
|
|
12
|
+
const wrappedSchema = applyMiddleware(schema, ...middlewares);
|
|
16
13
|
wrappedSchema.extensions = {
|
|
17
14
|
...schema.extensions,
|
|
18
15
|
[graphqlMiddlewareAppliedTransformSymbol]: true,
|
|
@@ -22,4 +19,3 @@ const useGraphQLMiddleware = (middlewares) => {
|
|
|
22
19
|
},
|
|
23
20
|
};
|
|
24
21
|
};
|
|
25
|
-
exports.useGraphQLMiddleware = useGraphQLMiddleware;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/graphql-middleware",
|
|
3
|
-
"version": "3.4.0-alpha-
|
|
3
|
+
"version": "3.4.0-alpha-05dbec7.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "2.4.0-alpha-
|
|
6
|
+
"@envelop/core": "2.4.0-alpha-05dbec7.0",
|
|
7
7
|
"graphql-middleware": "^6.0.0",
|
|
8
8
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
9
9
|
},
|