[X] Tests for the changes have been added (for bug fixes / features)
[ ] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:
What is the current behavior?
Subscriptions created by utilizing the @nestjs/graphql related libs only serve updates triggered by the PubSub.asyncIterator while in some circumstances a subscription may serve initial data to avoid a Query + Subscription scenario resulting in complicated merges within the clients' business logic.
Issue Number: N/A
What is the new behavior?
A utils function has been added which can be used to combine an AsyncIterator with an array of existing data returning an AsyncIterableIterator which does satisfy the AsyncIterator interface - meaning that existing code / frameworks will not be broken if employed - while serving the list of initial entries first, followed by all real-time updates triggered via the PubSub iterator.
Does this PR introduce a breaking change?
[ ] Yes
[X] No
Other information
The apollo package may not be the right place to store such utils, feedback would be highly appreciated!
Furthermore, an update to linting related dependencies had to be made in order to run the husky pre-commit locally.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Subscriptions created by utilizing the @nestjs/graphql related libs only serve updates triggered by the
PubSub.asyncIterator
while in some circumstances a subscription may serve initial data to avoid a Query + Subscription scenario resulting in complicated merges within the clients' business logic.Issue Number: N/A
What is the new behavior?
A utils function has been added which can be used to combine an
AsyncIterator
with an array of existing data returning anAsyncIterableIterator
which does satisfy theAsyncIterator
interface - meaning that existing code / frameworks will not be broken if employed - while serving the list of initial entries first, followed by all real-time updates triggered via the PubSub iterator.Does this PR introduce a breaking change?
Other information
The
apollo
package may not be the right place to store such utils, feedback would be highly appreciated! Furthermore, an update to linting related dependencies had to be made in order to run the husky pre-commit locally.