Skip to content

Commit 81028b3

Browse files
feat(graphql): allow fresh fetchPolicy to ObservableQuery.fetchResults
Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent d80094d commit 81028b3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/graphql/lib/src/core/observable_query.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ class ObservableQuery<TParsed> {
189189
///
190190
/// Will [startPolling] if [options.pollInterval] is set
191191
MultiSourceResult<TParsed> fetchResults({FetchPolicy? fetchPolicy}) {
192-
final fetchOptions = fetchPolicy == null
193-
? options
194-
: options.copyWithFetchPolicy(fetchPolicy);
192+
final fetchOptions = fetchPolicy == null
193+
? options
194+
: options.copyWithFetchPolicy(fetchPolicy);
195195
final MultiSourceResult<TParsed> allResults =
196196
queryManager.fetchQueryAsMultiSourceResult(queryId, fetchOptions);
197197
latestResult ??= allResults.eagerResult;
@@ -207,7 +207,8 @@ class ObservableQuery<TParsed> {
207207
: QueryLifecycle.pending;
208208
}
209209

210-
if (fetchOptions.pollInterval != null && fetchOptions.pollInterval! > Duration.zero) {
210+
if (fetchOptions.pollInterval != null &&
211+
fetchOptions.pollInterval! > Duration.zero) {
211212
startPolling(fetchOptions.pollInterval);
212213
}
213214

0 commit comments

Comments
 (0)