@@ -27,6 +27,7 @@ class QueryOptions<TParsed extends Object?> extends BaseOptions<TParsed> {
27
27
this .pollInterval,
28
28
Context ? context,
29
29
ResultParserFn <TParsed >? parserFn,
30
+ Duration ? queryRequestTimeout,
30
31
this .onComplete,
31
32
this .onError,
32
33
}) : super (
@@ -39,6 +40,7 @@ class QueryOptions<TParsed extends Object?> extends BaseOptions<TParsed> {
39
40
context: context,
40
41
optimisticResult: optimisticResult,
41
42
parserFn: parserFn,
43
+ queryRequestTimeout: queryRequestTimeout,
42
44
);
43
45
44
46
final OnQueryComplete ? onComplete;
@@ -68,6 +70,7 @@ class QueryOptions<TParsed extends Object?> extends BaseOptions<TParsed> {
68
70
Duration ? pollInterval,
69
71
Context ? context,
70
72
ResultParserFn <TParsed >? parserFn,
73
+ Duration ? queryRequestTimeout,
71
74
OnQueryComplete ? onComplete,
72
75
OnQueryError ? onError,
73
76
}) =>
@@ -82,6 +85,7 @@ class QueryOptions<TParsed extends Object?> extends BaseOptions<TParsed> {
82
85
pollInterval: pollInterval ?? this .pollInterval,
83
86
context: context ?? this .context,
84
87
parserFn: parserFn ?? this .parserFn,
88
+ queryRequestTimeout: queryRequestTimeout ?? this .queryRequestTimeout,
85
89
onComplete: onComplete ?? this .onComplete,
86
90
onError: onError ?? this .onError,
87
91
);
@@ -95,6 +99,7 @@ class QueryOptions<TParsed extends Object?> extends BaseOptions<TParsed> {
95
99
fetchPolicy: FetchPolicy .noCache,
96
100
errorPolicy: errorPolicy,
97
101
parserFn: parserFn,
102
+ queryRequestTimeout: queryRequestTimeout,
98
103
context: context,
99
104
variables: {
100
105
...variables,
@@ -115,6 +120,7 @@ class QueryOptions<TParsed extends Object?> extends BaseOptions<TParsed> {
115
120
context: context,
116
121
optimisticResult: optimisticResult,
117
122
parserFn: parserFn,
123
+ queryRequestTimeout: queryRequestTimeout,
118
124
);
119
125
120
126
QueryOptions <TParsed > copyWithPolicies (Policies policies) => QueryOptions (
@@ -128,6 +134,7 @@ class QueryOptions<TParsed extends Object?> extends BaseOptions<TParsed> {
128
134
pollInterval: pollInterval,
129
135
context: context,
130
136
parserFn: parserFn,
137
+ queryRequestTimeout: queryRequestTimeout,
131
138
);
132
139
}
133
140
@@ -144,6 +151,7 @@ class SubscriptionOptions<TParsed extends Object?>
144
151
Object ? optimisticResult,
145
152
Context ? context,
146
153
ResultParserFn <TParsed >? parserFn,
154
+ Duration ? queryRequestTimeout,
147
155
}) : super (
148
156
fetchPolicy: fetchPolicy,
149
157
errorPolicy: errorPolicy,
@@ -154,6 +162,7 @@ class SubscriptionOptions<TParsed extends Object?>
154
162
context: context,
155
163
optimisticResult: optimisticResult,
156
164
parserFn: parserFn,
165
+ queryRequestTimeout: queryRequestTimeout,
157
166
);
158
167
SubscriptionOptions <TParsed > copyWithPolicies (Policies policies) =>
159
168
SubscriptionOptions (
@@ -166,6 +175,7 @@ class SubscriptionOptions<TParsed extends Object?>
166
175
optimisticResult: optimisticResult,
167
176
context: context,
168
177
parserFn: parserFn,
178
+ queryRequestTimeout: queryRequestTimeout,
169
179
);
170
180
}
171
181
@@ -185,6 +195,7 @@ class WatchQueryOptions<TParsed extends Object?> extends QueryOptions<TParsed> {
185
195
bool ? eagerlyFetchResults,
186
196
Context ? context,
187
197
ResultParserFn <TParsed >? parserFn,
198
+ Duration ? queryRequestTimeout,
188
199
}) : eagerlyFetchResults = eagerlyFetchResults ?? fetchResults,
189
200
super (
190
201
document: document,
@@ -197,6 +208,7 @@ class WatchQueryOptions<TParsed extends Object?> extends QueryOptions<TParsed> {
197
208
context: context,
198
209
optimisticResult: optimisticResult,
199
210
parserFn: parserFn,
211
+ queryRequestTimeout: queryRequestTimeout,
200
212
);
201
213
202
214
/// Whether or not to fetch results every time a new listener is added.
@@ -237,6 +249,7 @@ class WatchQueryOptions<TParsed extends Object?> extends QueryOptions<TParsed> {
237
249
bool ? eagerlyFetchResults,
238
250
Context ? context,
239
251
ResultParserFn <TParsed >? parserFn,
252
+ Duration ? queryRequestTimeout,
240
253
}) =>
241
254
WatchQueryOptions <TParsed >(
242
255
document: document ?? this .document,
@@ -253,6 +266,7 @@ class WatchQueryOptions<TParsed extends Object?> extends QueryOptions<TParsed> {
253
266
carryForwardDataOnException ?? this .carryForwardDataOnException,
254
267
context: context ?? this .context,
255
268
parserFn: parserFn ?? this .parserFn,
269
+ queryRequestTimeout: queryRequestTimeout ?? this .queryRequestTimeout,
256
270
);
257
271
258
272
WatchQueryOptions <TParsed > copyWithFetchPolicy (
@@ -272,6 +286,7 @@ class WatchQueryOptions<TParsed extends Object?> extends QueryOptions<TParsed> {
272
286
carryForwardDataOnException: carryForwardDataOnException,
273
287
context: context,
274
288
parserFn: parserFn,
289
+ queryRequestTimeout: queryRequestTimeout,
275
290
);
276
291
WatchQueryOptions <TParsed > copyWithPolicies (
277
292
Policies policies,
@@ -290,6 +305,7 @@ class WatchQueryOptions<TParsed extends Object?> extends QueryOptions<TParsed> {
290
305
carryForwardDataOnException: carryForwardDataOnException,
291
306
context: context,
292
307
parserFn: parserFn,
308
+ queryRequestTimeout: queryRequestTimeout,
293
309
);
294
310
295
311
WatchQueryOptions <TParsed > copyWithPollInterval (Duration ? pollInterval) =>
@@ -307,6 +323,7 @@ class WatchQueryOptions<TParsed extends Object?> extends QueryOptions<TParsed> {
307
323
carryForwardDataOnException: carryForwardDataOnException,
308
324
context: context,
309
325
parserFn: parserFn,
326
+ queryRequestTimeout: queryRequestTimeout,
310
327
);
311
328
312
329
WatchQueryOptions <TParsed > copyWithVariables (
@@ -325,6 +342,7 @@ class WatchQueryOptions<TParsed extends Object?> extends QueryOptions<TParsed> {
325
342
carryForwardDataOnException: carryForwardDataOnException,
326
343
context: context,
327
344
parserFn: parserFn,
345
+ queryRequestTimeout: queryRequestTimeout,
328
346
);
329
347
330
348
WatchQueryOptions <TParsed > copyWithOptimisticResult (
@@ -343,6 +361,7 @@ class WatchQueryOptions<TParsed extends Object?> extends QueryOptions<TParsed> {
343
361
carryForwardDataOnException: carryForwardDataOnException,
344
362
context: context,
345
363
parserFn: parserFn,
364
+ queryRequestTimeout: queryRequestTimeout,
346
365
);
347
366
}
348
367
@@ -358,6 +377,7 @@ class FetchMoreOptions {
358
377
this .document,
359
378
this .variables = const {},
360
379
required this .updateQuery,
380
+ Duration ? queryRequestTimeout,
361
381
});
362
382
363
383
/// Automatically merge the results of [updateQuery] into `previousResultData` .
@@ -369,11 +389,13 @@ class FetchMoreOptions {
369
389
DocumentNode ? document,
370
390
Map <String , dynamic > variables = const {},
371
391
required UpdateQuery updateQuery,
392
+ Duration ? queryRequestTimeout,
372
393
}) =>
373
394
FetchMoreOptions (
374
395
document: document,
375
396
variables: variables,
376
397
updateQuery: partialUpdater (updateQuery),
398
+ queryRequestTimeout: queryRequestTimeout,
377
399
);
378
400
379
401
final DocumentNode ? document;
0 commit comments