@envelop/execute-subscription-event 2.5.1-alpha-20220824165935-4720f031 → 2.6.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/README.md CHANGED
@@ -7,16 +7,11 @@ Utilities for hooking into the [ExecuteSubscriptionEvent](<https://spec.graphql.
7
7
  Create a new context object per `ExecuteSubscriptionEvent` phase, allowing to bypass common issues with context objects such as [`DataLoader`](https://github.com/n1ru4l/envelop/issues/80) [caching](https://github.com/graphql/graphql-js/issues/894) [issues](https://github.com/apollographql/subscriptions-transport-ws/issues/330).
8
8
 
9
9
  ```ts
10
- import { parse, validate, execute, subscribe } from 'graphql'
11
10
  import { envelop } from '@envelop/core'
12
11
  import { useContextValuePerExecuteSubscriptionEvent } from '@envelop/execute-subscription-event'
13
12
  import { createContext, createDataLoaders } from './context'
14
13
 
15
14
  const getEnveloped = envelop({
16
- parse,
17
- validate,
18
- execute,
19
- subscribe,
20
15
  plugins: [
21
16
  useContext(() => createContext()),
22
17
  useContextValuePerExecuteSubscriptionEvent(() => ({
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@envelop/execute-subscription-event",
3
- "version": "2.5.1-alpha-20220824165935-4720f031",
3
+ "version": "2.6.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@envelop/core": "2.5.1-alpha-20220824165935-4720f031",
6
+ "@envelop/core": "^2.6.0",
7
7
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
8
8
  },
9
- "dependencies": {},
9
+ "dependencies": {
10
+ "tslib": "^2.4.0"
11
+ },
10
12
  "repository": {
11
13
  "type": "git",
12
14
  "url": "https://github.com/n1ru4l/envelop.git",
@@ -11,4 +11,4 @@ export declare type ContextFactoryHook<TContextValue> = {
11
11
  onEnd?: () => void;
12
12
  };
13
13
  export declare type ContextFactoryType<TContextValue = DefaultContext> = (options: ContextFactoryOptions) => PromiseOrValue<ContextFactoryHook<TContextValue> | void>;
14
- export declare const useExtendContextValuePerExecuteSubscriptionEvent: <TContextValue = unknown>(createContext: ContextFactoryType<TContextValue>) => Plugin<TContextValue>;
14
+ export declare const useExtendContextValuePerExecuteSubscriptionEvent: <TContextValue extends Record<any, any>>(createContext: ContextFactoryType<TContextValue>) => Plugin<TContextValue>;
@@ -11,4 +11,4 @@ export declare type ContextFactoryHook<TContextValue> = {
11
11
  onEnd?: () => void;
12
12
  };
13
13
  export declare type ContextFactoryType<TContextValue = DefaultContext> = (options: ContextFactoryOptions) => PromiseOrValue<ContextFactoryHook<TContextValue> | void>;
14
- export declare const useExtendContextValuePerExecuteSubscriptionEvent: <TContextValue = unknown>(createContext: ContextFactoryType<TContextValue>) => Plugin<TContextValue>;
14
+ export declare const useExtendContextValuePerExecuteSubscriptionEvent: <TContextValue extends Record<any, any>>(createContext: ContextFactoryType<TContextValue>) => Plugin<TContextValue>;