@@ -182,12 +182,18 @@ class ObservableQuery<TParsed> {
182182 }
183183 }
184184
185- /// Fetch results based on [options.fetchPolicy]
185+ /// Fetch results based on [options.fetchPolicy] by default.
186+ ///
187+ /// Optionally provide a [fetchPolicy] which will override the
188+ /// default [options.fetchPolicy] , just for this request.
186189 ///
187190 /// Will [startPolling] if [options.pollInterval] is set
188- MultiSourceResult <TParsed > fetchResults () {
191+ MultiSourceResult <TParsed > fetchResults ({FetchPolicy ? fetchPolicy}) {
192+ final fetchOptions = fetchPolicy == null
193+ ? options
194+ : options.copyWithFetchPolicy (fetchPolicy);
189195 final MultiSourceResult <TParsed > allResults =
190- queryManager.fetchQueryAsMultiSourceResult (queryId, options );
196+ queryManager.fetchQueryAsMultiSourceResult (queryId, fetchOptions );
191197 latestResult ?? = allResults.eagerResult;
192198
193199 if (allResults.networkResult == null ) {
@@ -201,8 +207,9 @@ class ObservableQuery<TParsed> {
201207 : QueryLifecycle .pending;
202208 }
203209
204- if (options.pollInterval != null && options.pollInterval! > Duration .zero) {
205- startPolling (options.pollInterval);
210+ if (fetchOptions.pollInterval != null &&
211+ fetchOptions.pollInterval! > Duration .zero) {
212+ startPolling (fetchOptions.pollInterval);
206213 }
207214
208215 return allResults;
0 commit comments