|
1 | 1 | import { after } from '../jsutils/after.js';
|
| 2 | +import { afterMaybeAsync } from '../jsutils/afterMaybeAsync.js'; |
2 | 3 | import { catchAfter } from '../jsutils/catchAfter.js';
|
3 | 4 | import { inspect } from '../jsutils/inspect.js';
|
4 | 5 | import { invariant } from '../jsutils/invariant.js';
|
@@ -1282,7 +1283,7 @@ function completeAbstractValue(
|
1282 | 1283 | const runtimeType = resolveTypeFn(result, contextValue, info, returnType);
|
1283 | 1284 |
|
1284 | 1285 | if (isPromise(runtimeType)) {
|
1285 |
| - return after(runtimeType, (resolvedRuntimeType) => |
| 1286 | + return afterMaybeAsync(runtimeType, (resolvedRuntimeType) => |
1286 | 1287 | completeObjectValue(
|
1287 | 1288 | exeContext,
|
1288 | 1289 | ensureValidRuntimeType(
|
@@ -1394,7 +1395,7 @@ function completeObjectValue(
|
1394 | 1395 | const isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info);
|
1395 | 1396 |
|
1396 | 1397 | if (isPromise(isTypeOf)) {
|
1397 |
| - return after(isTypeOf, (resolvedIsTypeOf) => { |
| 1398 | + return afterMaybeAsync(isTypeOf, (resolvedIsTypeOf) => { |
1398 | 1399 | if (!resolvedIsTypeOf) {
|
1399 | 1400 | throw invalidReturnTypeError(returnType, result, fieldNodes);
|
1400 | 1401 | }
|
@@ -2314,7 +2315,7 @@ class DeferredFragmentRecord {
|
2314 | 2315 | addData(data: PromiseOrValue<ObjMap<unknown> | null>) {
|
2315 | 2316 | const parentData = this.parentContext?.promise;
|
2316 | 2317 | if (parentData) {
|
2317 |
| - this._resolve?.(after(parentData, () => data)); |
| 2318 | + this._resolve?.(afterMaybeAsync(parentData, () => data)); |
2318 | 2319 | return;
|
2319 | 2320 | }
|
2320 | 2321 | this._resolve?.(data);
|
@@ -2368,7 +2369,7 @@ class StreamRecord {
|
2368 | 2369 | addItems(items: PromiseOrValue<Array<unknown> | null>) {
|
2369 | 2370 | const parentData = this.parentContext?.promise;
|
2370 | 2371 | if (parentData) {
|
2371 |
| - this._resolve?.(after(parentData, () => items)); |
| 2372 | + this._resolve?.(afterMaybeAsync(parentData, () => items)); |
2372 | 2373 | return;
|
2373 | 2374 | }
|
2374 | 2375 | this._resolve?.(items);
|
|
0 commit comments