Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR committed Mar 27, 2024
1 parent 5166848 commit 52c5fdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/execution/__tests__/stream-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,7 @@ describe('Execute: stream directive', () => {
done: true,
});
});
it('Can @defer fields that are resolved before async iterable is complete', async () => {
it.skip('Can @defer fields that are resolved before async iterable is complete', async () => {
const { promise: slowFieldPromise, resolve: resolveSlowField } =
promiseWithResolvers();
const {
Expand Down
7 changes: 3 additions & 4 deletions src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type { Path } from '../jsutils/Path.js';
import { addPath, pathToArray } from '../jsutils/Path.js';
import type { PromiseOrValue } from '../jsutils/PromiseOrValue.js';
import { promiseReduce } from '../jsutils/promiseReduce.js';
import { resolveAfterAll } from '../jsutils/resolveAfterAll.js';

import { GraphQLError } from '../error/GraphQLError.js';
import { locatedError } from '../error/locatedError.js';
Expand Down Expand Up @@ -630,7 +629,7 @@ function executeFields(
// Otherwise, results is a map from field name to the result of resolving that
// field, which is possibly a promise. Return a promise that will return this
// same map, but with any promises replaced with the values they resolved to.
return resolveAfterAll(acc, promises);
return Promise.all(promises).then(() => acc);
}

function toNodes(fieldGroup: FieldGroup): ReadonlyArray<FieldNode> {
Expand Down Expand Up @@ -1105,7 +1104,7 @@ async function completeAsyncIteratorValue(
index += 1;
}

return promises.length > 0 ? resolveAfterAll(acc, promises) : acc;
return promises.length > 0 ? Promise.all(promises).then(() => acc) : acc;
}

/**
Expand Down Expand Up @@ -1208,7 +1207,7 @@ function completeListValue(
iteration = iterator.next();
}

return promises.length > 0 ? resolveAfterAll(acc, promises) : acc;
return promises.length > 0 ? Promise.all(promises).then(() => acc) : acc;
}

/**
Expand Down

0 comments on commit 52c5fdf

Please sign in to comment.