@envelop/graphql-middleware 3.6.0 → 3.6.1-alpha-20220901205925-b1fd44a9

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/README.md CHANGED
@@ -15,6 +15,7 @@ yarn add graphql-middleware @envelop/graphql-middleware
15
15
  You can use any type of middleware defined for `graphql-middleware`, here's an example for doing that with [`graphql-shield`](https://github.com/maticzav/graphql-shield):
16
16
 
17
17
  ```ts
18
+ import { parse, validate, execute, subscribe } from 'graphql'
18
19
  import { envelop } from '@envelop/core'
19
20
  import { useGraphQLMiddleware } from '@envelop/graphql-middleware'
20
21
  import { rule, shield, and, or, not } from 'graphql-shield'
@@ -35,6 +36,10 @@ const permissions = shield({
35
36
  })
36
37
 
37
38
  const getEnveloped = envelop({
39
+ parse,
40
+ validate,
41
+ execute,
42
+ subscribe,
38
43
  plugins: [
39
44
  // ... other plugins ...
40
45
  useSchema(mySchema),
package/cjs/index.js CHANGED
@@ -6,9 +6,7 @@ const graphqlMiddlewareAppliedTransformSymbol = Symbol('graphqlMiddleware.applie
6
6
  const useGraphQLMiddleware = (middlewares) => {
7
7
  return {
8
8
  onSchemaChange({ schema, replaceSchema }) {
9
- var _a;
10
- // @ts-expect-error See https://github.com/graphql/graphql-js/pull/3511 - remove this comments once merged
11
- if ((_a = schema.extensions) === null || _a === void 0 ? void 0 : _a[graphqlMiddlewareAppliedTransformSymbol]) {
9
+ if (schema.extensions?.[graphqlMiddlewareAppliedTransformSymbol]) {
12
10
  return;
13
11
  }
14
12
  if (middlewares.length > 0) {
package/esm/index.js CHANGED
@@ -3,9 +3,7 @@ const graphqlMiddlewareAppliedTransformSymbol = Symbol('graphqlMiddleware.applie
3
3
  export const useGraphQLMiddleware = (middlewares) => {
4
4
  return {
5
5
  onSchemaChange({ schema, replaceSchema }) {
6
- var _a;
7
- // @ts-expect-error See https://github.com/graphql/graphql-js/pull/3511 - remove this comments once merged
8
- if ((_a = schema.extensions) === null || _a === void 0 ? void 0 : _a[graphqlMiddlewareAppliedTransformSymbol]) {
6
+ if (schema.extensions?.[graphqlMiddlewareAppliedTransformSymbol]) {
9
7
  return;
10
8
  }
11
9
  if (middlewares.length > 0) {
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@envelop/graphql-middleware",
3
- "version": "3.6.0",
3
+ "version": "3.6.1-alpha-20220901205925-b1fd44a9",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@envelop/core": "^2.6.0",
6
+ "@envelop/core": "2.6.1-alpha-20220901205925-b1fd44a9",
7
7
  "graphql-middleware": "^6.0.0",
8
8
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
9
9
  },