Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

(core) - update toPromise to exclude `hasNext` results (#1880)

* update toPromise to exclude `hasNext` results

This change ensures that when we call `toPromise()` on a query we wont serve an incomplete result, the user will expect to receive a non-stale full-result when using `toPromise()`

* Create thick-seals-wait.md

authored by

Jovi De Croock and committed by
GitHub
96cfe9eb 30eb7941

+8 -1
+7
.changeset/thick-seals-wait.md
··· 1 + --- 2 + "@urql/core": patch 3 + --- 4 + 5 + Fix: update toPromise to exclude `hasNext` results. This change ensures that 6 + when we call toPromise() on a query we wont serve an incomplete result, the 7 + user will expect to receive a non-stale full-result when using toPromise()
+1 -1
packages/core/src/utils/streamUtils.ts
··· 7 7 (source$ as PromisifiedSource<T>).toPromise = () => { 8 8 return pipe( 9 9 source$, 10 - filter(result => !result.stale), 10 + filter(result => !result.stale && !result.hasNext), 11 11 take(1), 12 12 toPromise 13 13 );