@envelop/core 2.1.0 → 2.1.1-alpha-e859732.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/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/core",
|
|
3
|
-
"version": "2.1.0",
|
|
3
|
+
"version": "2.1.1-alpha-e859732.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@envelop/types": "2.0.0"
|
|
9
|
+
"@envelop/types": "2.0.1-alpha-e859732.0"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Plugin, DefaultContext } from '@envelop/types';
|
|
2
2
|
import { GraphQLError } from 'graphql';
|
|
3
3
|
export declare type ErrorHandler = (errors: readonly GraphQLError[], context: Readonly<DefaultContext>) => void;
|
|
4
|
-
export declare const useErrorHandler: <ContextType>(errorHandler: ErrorHandler) => Plugin<ContextType>;
|
|
4
|
+
export declare const useErrorHandler: <ContextType>(errorHandler: ErrorHandler) => Plugin<ContextType, ContextType>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from '@envelop/types';
|
|
2
2
|
export declare type ContextFactoryFn<TResult = unknown, TCurrent = unknown> = (currentContext: TCurrent) => TResult | Promise<TResult>;
|
|
3
3
|
declare type UnwrapAsync<T> = T extends Promise<infer U> ? U : T;
|
|
4
|
-
export declare const useExtendContext: <TContextFactory extends (...args: any[]) => any>(contextFactory: TContextFactory) => Plugin<UnwrapAsync<ReturnType<TContextFactory>>>;
|
|
4
|
+
export declare const useExtendContext: <TContextFactory extends (...args: any[]) => any>(contextFactory: TContextFactory) => Plugin<UnwrapAsync<ReturnType<TContextFactory>>, UnwrapAsync<ReturnType<TContextFactory>>>;
|
|
5
5
|
export {};
|
package/utils.d.ts
CHANGED
|
@@ -28,6 +28,6 @@ export declare function isAsyncIterable<TType>(maybeAsyncIterable: unknown): may
|
|
|
28
28
|
* @param fn The handler to be executed on each result
|
|
29
29
|
* @returns a subscription for streamed results, or undefined in case of an non-async
|
|
30
30
|
*/
|
|
31
|
-
export declare function handleStreamOrSingleExecutionResult<
|
|
31
|
+
export declare function handleStreamOrSingleExecutionResult<TInputContext = DefaultContext, TOutputContext = TInputContext>(payload: OnExecuteDoneEventPayload<TInputContext, TOutputContext>, fn: OnExecuteDoneHookResultOnNextHook<TInputContext, TOutputContext>): void | OnExecuteDoneHookResult<TInputContext, TOutputContext>;
|
|
32
32
|
export declare function finalAsyncIterator<TInput>(source: AsyncIterable<TInput>, onFinal: () => void): AsyncGenerator<TInput>;
|
|
33
33
|
export declare function errorAsyncIterator<TInput>(source: AsyncIterable<TInput>, onError: (err: unknown) => void): AsyncGenerator<TInput>;
|