Skip to content

Commit 86b2e57

Browse files
committed
add isAsyncIterable
we could consider later adding support for $$asyncIterable similar to upstream graphql-js, but this would have to be across the entire codebase, which currently supports only Symbol.asyncIterator.
1 parent 0737343 commit 86b2e57

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/utils/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ export * from './observableToAsyncIterable';
4848
export * from './visitResult';
4949
export * from './getArgumentValues';
5050
export * from './valueMatchesCriteria';
51+
export * from './isAsyncIterable';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function isAsyncIterable<T>(value: any): value is AsyncIterable<T> {
2+
return Symbol.asyncIterator in value;
3+
}

0 commit comments

Comments
 (0)