apollographql / apollographql/graphql-subscriptions

pubSub.asyncIterator() return type

Open
#192 5 comments 1 reaction 0 assignees View on GitHub
enhancement good first issue
Dominant language
TypeScript
Stars
1.6k
Forks
129
PR merge metrics
No merged PRs in 30d

Description

Shouldn't the return type be `AsyncIterableIterator` ([TS lib file](https://github.com/Microsoft/TypeScript/blob/master/lib/lib.es2018.asynciterable.d.ts#L42)) instead of `AsyncIterator`? I see it has the `Symbol.asyncIterator` property [here](https://github.com/apollographql/graphql-subscriptions/blob/master/src/event-emitter-to-async-iterator.ts#L71)

Contributor guide

Open the contributing guide

Research direction

Start with src/event-emitter-to-async-iterator.ts, especially the implementation around the Symbol.asyncIterator property, and inspect the declared return type of pubSub.asyncIterator(). Compare it with TypeScript's AsyncIterableIterator definition in lib.es2018.asynciterable.d.ts. Done means the public return type accurately reflects the implemented iterator.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.