@gqloom/core 0.10.0 → 0.11.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/dist/chunk-Cl8Af3a2.js +11 -0
- package/dist/context-3UlS1xGQ.cjs +417 -0
- package/dist/context-CpbCknos.js +305 -0
- package/dist/context.cjs +236 -437
- package/dist/context.d.cts +114 -111
- package/dist/context.d.ts +114 -111
- package/dist/context.js +224 -219
- package/dist/index-DUqXX1Tm.d.cts +1255 -0
- package/dist/index-GSWAHvDy.d.ts +1253 -0
- package/dist/index.cjs +1694 -2019
- package/dist/index.d.cts +2 -484
- package/dist/index.d.ts +2 -484
- package/dist/index.js +1618 -1780
- package/package.json +11 -11
- package/dist/chunk-JWAIAFGL.js +0 -220
- package/dist/context-uzUlbx3r.d.cts +0 -772
- package/dist/context-uzUlbx3r.d.ts +0 -772
package/dist/context.d.cts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AsyncLocalStorage } from
|
|
3
|
-
|
|
1
|
+
import { BaseField, Middleware, OnlyMemoizationPayload, ResolverPayload, ResolvingFields } from "./index-DUqXX1Tm.cjs";
|
|
2
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
+
|
|
4
|
+
//#region src/context/context.d.ts
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* the AsyncLocalStorage instance to store the resolver payload
|
|
7
8
|
*/
|
|
8
|
-
declare const resolverPayloadStorage: AsyncLocalStorage<
|
|
9
|
+
declare const resolverPayloadStorage: AsyncLocalStorage<ResolverPayload<object, BaseField> | OnlyMemoizationPayload>;
|
|
9
10
|
/**
|
|
10
11
|
* use detailed payload of the current resolver
|
|
11
12
|
* @returns the resolver payload
|
|
@@ -21,8 +22,8 @@ declare function useContext<TContextType = object>(): TContextType;
|
|
|
21
22
|
*/
|
|
22
23
|
declare function useMemoizationMap(): WeakMap<WeakKey, any> | undefined;
|
|
23
24
|
interface ContextOptions {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
getContextMap: () => WeakMap<WeakKey, any> | undefined;
|
|
26
|
+
key: WeakKey;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* A class that provides dependency injection and context sharing capabilities.
|
|
@@ -32,75 +33,75 @@ interface ContextOptions {
|
|
|
32
33
|
*
|
|
33
34
|
*/
|
|
34
35
|
declare class InjectableContext<T> implements ContextOptions {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
36
|
+
readonly getter: () => T;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new instance of InjectableContext.
|
|
39
|
+
*
|
|
40
|
+
* @param getter - A function that returns the default value when no custom implementation is provided
|
|
41
|
+
* @param options - Optional configuration for the context
|
|
42
|
+
* @param options.getContextMap - A function that returns the WeakMap used to store context values. Defaults to useMemoizationMap
|
|
43
|
+
* @param options.key - A unique key used to identify this context in the WeakMap. Defaults to the getter function
|
|
44
|
+
*/
|
|
45
|
+
constructor(getter: () => T, options?: Partial<ContextOptions>);
|
|
46
|
+
/**
|
|
47
|
+
* A function that returns the WeakMap used to store context values.
|
|
48
|
+
* This can be customized to use different storage mechanisms.
|
|
49
|
+
*/
|
|
50
|
+
getContextMap: () => WeakMap<WeakKey, any> | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* A unique key used to identify this context in the WeakMap.
|
|
53
|
+
* This is used to store and retrieve values from the context map.
|
|
54
|
+
*/
|
|
55
|
+
readonly key: WeakKey;
|
|
56
|
+
/**
|
|
57
|
+
* Retrieves the value from the context.
|
|
58
|
+
* If a custom implementation is provided, it will be used.
|
|
59
|
+
* Otherwise, the default getter function will be called.
|
|
60
|
+
*
|
|
61
|
+
* @returns The value of type T
|
|
62
|
+
*/
|
|
63
|
+
get(): T;
|
|
64
|
+
/**
|
|
65
|
+
* Provides a new implementation for this context.
|
|
66
|
+
*
|
|
67
|
+
* @param getter - A function that returns the new value
|
|
68
|
+
* @returns A tuple containing the key and the new getter function
|
|
69
|
+
*/
|
|
70
|
+
provide(getter: () => T): [WeakKey, () => T];
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* Create a memoization in context to store the result of a getter function
|
|
73
74
|
*/
|
|
74
75
|
declare class ContextMemoization<T> implements ContextOptions {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
76
|
+
readonly getter: () => T;
|
|
77
|
+
constructor(getter: () => T, options?: Partial<ContextOptions>);
|
|
78
|
+
getContextMap: () => WeakMap<WeakKey, any> | undefined;
|
|
79
|
+
readonly key: WeakKey;
|
|
80
|
+
/**
|
|
81
|
+
* Get the value in memoization or call the getter function
|
|
82
|
+
* @returns the value of the getter function
|
|
83
|
+
*/
|
|
84
|
+
get(): T;
|
|
85
|
+
/**
|
|
86
|
+
* Clear the memoization
|
|
87
|
+
* @returns true if the memoization is cleared, undefined if the context is not found
|
|
88
|
+
*/
|
|
89
|
+
clear(): boolean | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Check if the memoization exists
|
|
92
|
+
* @returns true if the memoization exists, undefined if the context is not found
|
|
93
|
+
*/
|
|
94
|
+
exists(): boolean | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Set a new value to the memoization
|
|
97
|
+
* @param value the new value to set
|
|
98
|
+
* @returns the memoization map or undefined if the context is not found
|
|
99
|
+
*/
|
|
100
|
+
set(value: T): WeakMap<WeakKey, any> | undefined;
|
|
101
|
+
provide(value: T): [WeakKey, T];
|
|
101
102
|
}
|
|
102
103
|
interface CallableContext<T> extends InjectableContext<T> {
|
|
103
|
-
|
|
104
|
+
(): T;
|
|
104
105
|
}
|
|
105
106
|
/**
|
|
106
107
|
* Create a callable context
|
|
@@ -112,54 +113,55 @@ declare function createContext<T>(...args: ConstructorParameters<typeof Injectab
|
|
|
112
113
|
* Async Memoization with a callable function
|
|
113
114
|
*/
|
|
114
115
|
interface CallableContextMemoization<T> extends ContextMemoization<T> {
|
|
115
|
-
|
|
116
|
+
(): T;
|
|
116
117
|
}
|
|
117
118
|
/**
|
|
118
119
|
* Create a memoization in context to store the result of a getter function
|
|
119
120
|
*/
|
|
120
121
|
declare function createMemoization<T>(...args: ConstructorParameters<typeof ContextMemoization<T>>): CallableContextMemoization<T>;
|
|
121
122
|
interface AsyncContextProvider extends Middleware {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
123
|
+
/**
|
|
124
|
+
* Creates a middleware that injects key-value pairs into the context during resolver execution.
|
|
125
|
+
* The injected values will be available throughout the entire resolver execution chain.
|
|
126
|
+
*
|
|
127
|
+
* @param keyValues - An array of tuples containing a WeakKey and its corresponding value
|
|
128
|
+
* @returns A middleware function that injects the provided key-value pairs into the context
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* const executor = resolver.toExecutor(
|
|
133
|
+
* asyncContextProvider.with(
|
|
134
|
+
* useDefaultName.provide(() => "Default Name")
|
|
135
|
+
* )
|
|
136
|
+
* )
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
with: (...keyValues: [WeakKey, any][]) => Middleware;
|
|
140
|
+
/**
|
|
141
|
+
* Executes an async function with injected context values.
|
|
142
|
+
* The provided key-value pairs will be available in the context during the function execution.
|
|
143
|
+
*
|
|
144
|
+
* @template T - The return type of the async function
|
|
145
|
+
* @param resolve - The async function to execute
|
|
146
|
+
* @param keyValues - An array of tuples containing a WeakKey and its corresponding value
|
|
147
|
+
* @returns A Promise that resolves to the result of the async function
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* const result = await asyncContextProvider.run(
|
|
152
|
+
* async () => {
|
|
153
|
+
* const name = useDefaultName()
|
|
154
|
+
* return `Hello, ${name}!`
|
|
155
|
+
* },
|
|
156
|
+
* useDefaultName.provide(() => "John")
|
|
157
|
+
* )
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
run: <T>(resolve: () => Promise<T>, ...keyValues: [WeakKey, any][]) => Promise<T>;
|
|
160
161
|
}
|
|
161
162
|
declare const asyncContextProvider: AsyncContextProvider;
|
|
162
|
-
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/context/use-resolving-fields.d.ts
|
|
163
165
|
/**
|
|
164
166
|
* A hook that analyzes and processes field resolution in a GraphQL query.
|
|
165
167
|
*
|
|
@@ -167,8 +169,9 @@ declare const asyncContextProvider: AsyncContextProvider;
|
|
|
167
169
|
* or undefined if no resolver payload is available
|
|
168
170
|
*/
|
|
169
171
|
declare const useResolvingFields: CallableContext<ResolvingFields | undefined>;
|
|
170
|
-
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/context/async-iterator.d.ts
|
|
171
174
|
declare function bindAsyncIterator<TAsyncLocalStorage extends AsyncLocalStorage<unknown>, TAsyncIterator extends AsyncIterator<unknown, unknown, unknown>>(storage: TAsyncLocalStorage, generator: TAsyncIterator): TAsyncIterator;
|
|
172
175
|
declare function isAsyncIterator(value: unknown): value is AsyncIterator<unknown, unknown, unknown>;
|
|
173
|
-
|
|
174
|
-
export {
|
|
176
|
+
//#endregion
|
|
177
|
+
export { AsyncContextProvider, CallableContext, CallableContextMemoization, ContextMemoization, InjectableContext, asyncContextProvider, bindAsyncIterator, createContext, createMemoization, isAsyncIterator, resolverPayloadStorage, useContext, useMemoizationMap, useResolverPayload, useResolvingFields };
|
package/dist/context.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AsyncLocalStorage } from
|
|
3
|
-
|
|
1
|
+
import { BaseField, Middleware, OnlyMemoizationPayload, ResolverPayload, ResolvingFields } from "./index-GSWAHvDy.js";
|
|
2
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
+
|
|
4
|
+
//#region src/context/context.d.ts
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* the AsyncLocalStorage instance to store the resolver payload
|
|
7
8
|
*/
|
|
8
|
-
declare const resolverPayloadStorage: AsyncLocalStorage<
|
|
9
|
+
declare const resolverPayloadStorage: AsyncLocalStorage<ResolverPayload<object, BaseField> | OnlyMemoizationPayload>;
|
|
9
10
|
/**
|
|
10
11
|
* use detailed payload of the current resolver
|
|
11
12
|
* @returns the resolver payload
|
|
@@ -21,8 +22,8 @@ declare function useContext<TContextType = object>(): TContextType;
|
|
|
21
22
|
*/
|
|
22
23
|
declare function useMemoizationMap(): WeakMap<WeakKey, any> | undefined;
|
|
23
24
|
interface ContextOptions {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
getContextMap: () => WeakMap<WeakKey, any> | undefined;
|
|
26
|
+
key: WeakKey;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* A class that provides dependency injection and context sharing capabilities.
|
|
@@ -32,75 +33,75 @@ interface ContextOptions {
|
|
|
32
33
|
*
|
|
33
34
|
*/
|
|
34
35
|
declare class InjectableContext<T> implements ContextOptions {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
36
|
+
readonly getter: () => T;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new instance of InjectableContext.
|
|
39
|
+
*
|
|
40
|
+
* @param getter - A function that returns the default value when no custom implementation is provided
|
|
41
|
+
* @param options - Optional configuration for the context
|
|
42
|
+
* @param options.getContextMap - A function that returns the WeakMap used to store context values. Defaults to useMemoizationMap
|
|
43
|
+
* @param options.key - A unique key used to identify this context in the WeakMap. Defaults to the getter function
|
|
44
|
+
*/
|
|
45
|
+
constructor(getter: () => T, options?: Partial<ContextOptions>);
|
|
46
|
+
/**
|
|
47
|
+
* A function that returns the WeakMap used to store context values.
|
|
48
|
+
* This can be customized to use different storage mechanisms.
|
|
49
|
+
*/
|
|
50
|
+
getContextMap: () => WeakMap<WeakKey, any> | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* A unique key used to identify this context in the WeakMap.
|
|
53
|
+
* This is used to store and retrieve values from the context map.
|
|
54
|
+
*/
|
|
55
|
+
readonly key: WeakKey;
|
|
56
|
+
/**
|
|
57
|
+
* Retrieves the value from the context.
|
|
58
|
+
* If a custom implementation is provided, it will be used.
|
|
59
|
+
* Otherwise, the default getter function will be called.
|
|
60
|
+
*
|
|
61
|
+
* @returns The value of type T
|
|
62
|
+
*/
|
|
63
|
+
get(): T;
|
|
64
|
+
/**
|
|
65
|
+
* Provides a new implementation for this context.
|
|
66
|
+
*
|
|
67
|
+
* @param getter - A function that returns the new value
|
|
68
|
+
* @returns A tuple containing the key and the new getter function
|
|
69
|
+
*/
|
|
70
|
+
provide(getter: () => T): [WeakKey, () => T];
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* Create a memoization in context to store the result of a getter function
|
|
73
74
|
*/
|
|
74
75
|
declare class ContextMemoization<T> implements ContextOptions {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
76
|
+
readonly getter: () => T;
|
|
77
|
+
constructor(getter: () => T, options?: Partial<ContextOptions>);
|
|
78
|
+
getContextMap: () => WeakMap<WeakKey, any> | undefined;
|
|
79
|
+
readonly key: WeakKey;
|
|
80
|
+
/**
|
|
81
|
+
* Get the value in memoization or call the getter function
|
|
82
|
+
* @returns the value of the getter function
|
|
83
|
+
*/
|
|
84
|
+
get(): T;
|
|
85
|
+
/**
|
|
86
|
+
* Clear the memoization
|
|
87
|
+
* @returns true if the memoization is cleared, undefined if the context is not found
|
|
88
|
+
*/
|
|
89
|
+
clear(): boolean | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Check if the memoization exists
|
|
92
|
+
* @returns true if the memoization exists, undefined if the context is not found
|
|
93
|
+
*/
|
|
94
|
+
exists(): boolean | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Set a new value to the memoization
|
|
97
|
+
* @param value the new value to set
|
|
98
|
+
* @returns the memoization map or undefined if the context is not found
|
|
99
|
+
*/
|
|
100
|
+
set(value: T): WeakMap<WeakKey, any> | undefined;
|
|
101
|
+
provide(value: T): [WeakKey, T];
|
|
101
102
|
}
|
|
102
103
|
interface CallableContext<T> extends InjectableContext<T> {
|
|
103
|
-
|
|
104
|
+
(): T;
|
|
104
105
|
}
|
|
105
106
|
/**
|
|
106
107
|
* Create a callable context
|
|
@@ -112,54 +113,55 @@ declare function createContext<T>(...args: ConstructorParameters<typeof Injectab
|
|
|
112
113
|
* Async Memoization with a callable function
|
|
113
114
|
*/
|
|
114
115
|
interface CallableContextMemoization<T> extends ContextMemoization<T> {
|
|
115
|
-
|
|
116
|
+
(): T;
|
|
116
117
|
}
|
|
117
118
|
/**
|
|
118
119
|
* Create a memoization in context to store the result of a getter function
|
|
119
120
|
*/
|
|
120
121
|
declare function createMemoization<T>(...args: ConstructorParameters<typeof ContextMemoization<T>>): CallableContextMemoization<T>;
|
|
121
122
|
interface AsyncContextProvider extends Middleware {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
123
|
+
/**
|
|
124
|
+
* Creates a middleware that injects key-value pairs into the context during resolver execution.
|
|
125
|
+
* The injected values will be available throughout the entire resolver execution chain.
|
|
126
|
+
*
|
|
127
|
+
* @param keyValues - An array of tuples containing a WeakKey and its corresponding value
|
|
128
|
+
* @returns A middleware function that injects the provided key-value pairs into the context
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* const executor = resolver.toExecutor(
|
|
133
|
+
* asyncContextProvider.with(
|
|
134
|
+
* useDefaultName.provide(() => "Default Name")
|
|
135
|
+
* )
|
|
136
|
+
* )
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
with: (...keyValues: [WeakKey, any][]) => Middleware;
|
|
140
|
+
/**
|
|
141
|
+
* Executes an async function with injected context values.
|
|
142
|
+
* The provided key-value pairs will be available in the context during the function execution.
|
|
143
|
+
*
|
|
144
|
+
* @template T - The return type of the async function
|
|
145
|
+
* @param resolve - The async function to execute
|
|
146
|
+
* @param keyValues - An array of tuples containing a WeakKey and its corresponding value
|
|
147
|
+
* @returns A Promise that resolves to the result of the async function
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* const result = await asyncContextProvider.run(
|
|
152
|
+
* async () => {
|
|
153
|
+
* const name = useDefaultName()
|
|
154
|
+
* return `Hello, ${name}!`
|
|
155
|
+
* },
|
|
156
|
+
* useDefaultName.provide(() => "John")
|
|
157
|
+
* )
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
run: <T>(resolve: () => Promise<T>, ...keyValues: [WeakKey, any][]) => Promise<T>;
|
|
160
161
|
}
|
|
161
162
|
declare const asyncContextProvider: AsyncContextProvider;
|
|
162
|
-
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/context/use-resolving-fields.d.ts
|
|
163
165
|
/**
|
|
164
166
|
* A hook that analyzes and processes field resolution in a GraphQL query.
|
|
165
167
|
*
|
|
@@ -167,8 +169,9 @@ declare const asyncContextProvider: AsyncContextProvider;
|
|
|
167
169
|
* or undefined if no resolver payload is available
|
|
168
170
|
*/
|
|
169
171
|
declare const useResolvingFields: CallableContext<ResolvingFields | undefined>;
|
|
170
|
-
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/context/async-iterator.d.ts
|
|
171
174
|
declare function bindAsyncIterator<TAsyncLocalStorage extends AsyncLocalStorage<unknown>, TAsyncIterator extends AsyncIterator<unknown, unknown, unknown>>(storage: TAsyncLocalStorage, generator: TAsyncIterator): TAsyncIterator;
|
|
172
175
|
declare function isAsyncIterator(value: unknown): value is AsyncIterator<unknown, unknown, unknown>;
|
|
173
|
-
|
|
174
|
-
export {
|
|
176
|
+
//#endregion
|
|
177
|
+
export { AsyncContextProvider, CallableContext, CallableContextMemoization, ContextMemoization, InjectableContext, asyncContextProvider, bindAsyncIterator, createContext, createMemoization, isAsyncIterator, resolverPayloadStorage, useContext, useMemoizationMap, useResolverPayload, useResolvingFields };
|