From b2bed956958b8332df0c12aa57e176c0dea980d1 Mon Sep 17 00:00:00 2001 From: Sebastian Garzon Date: Mon, 25 Nov 2024 14:15:34 -0500 Subject: [PATCH] fix(graphql): add queryRequestTimeout parameter to copyWith method --- packages/graphql/lib/src/graphql_client.dart | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/graphql/lib/src/graphql_client.dart b/packages/graphql/lib/src/graphql_client.dart index 6d7a1edf..a8addbe4 100644 --- a/packages/graphql/lib/src/graphql_client.dart +++ b/packages/graphql/lib/src/graphql_client.dart @@ -51,16 +51,20 @@ class GraphQLClient implements GraphQLDataProxy { late final QueryManager queryManager; /// Create a copy of the client with the provided information. - GraphQLClient copyWith( - {Link? link, - GraphQLCache? cache, - DefaultPolicies? defaultPolicies, - bool? alwaysRebroadcast}) { + GraphQLClient copyWith({ + Link? link, + GraphQLCache? cache, + DefaultPolicies? defaultPolicies, + bool? alwaysRebroadcast, + Duration? queryRequestTimeout, + }) { return GraphQLClient( - link: link ?? this.link, - cache: cache ?? this.cache, - defaultPolicies: defaultPolicies ?? this.defaultPolicies, - alwaysRebroadcast: alwaysRebroadcast ?? queryManager.alwaysRebroadcast); + link: link ?? this.link, + cache: cache ?? this.cache, + defaultPolicies: defaultPolicies ?? this.defaultPolicies, + alwaysRebroadcast: alwaysRebroadcast ?? queryManager.alwaysRebroadcast, + queryRequestTimeout: queryRequestTimeout ?? queryManager.requestTimeout, + ); } /// This registers a query in the [QueryManager] and returns an [ObservableQuery]