From acdaabc955b9200b35e4f6b16ab208c85873a0e4 Mon Sep 17 00:00:00 2001 From: aarsham Date: Sat, 30 Mar 2024 14:35:14 +0330 Subject: [PATCH] fix(graphql): check for null data returned from fetchMore.updateQuery before writing to cache --- packages/graphql/lib/src/core/fetch_more.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/graphql/lib/src/core/fetch_more.dart b/packages/graphql/lib/src/core/fetch_more.dart index 10c1a8fec..915c52027 100644 --- a/packages/graphql/lib/src/core/fetch_more.dart +++ b/packages/graphql/lib/src/core/fetch_more.dart @@ -34,11 +34,11 @@ Future> fetchMoreImplementation( final data = fetchMoreOptions.updateQuery( previousResult.data, fetchMoreResult.data, - )!; + ); fetchMoreResult.data = data; - if (originalOptions.fetchPolicy != FetchPolicy.noCache) { + if (originalOptions.fetchPolicy != FetchPolicy.noCache && data != null) { queryManager.attemptCacheWriteFromClient( request, data,