Skip to content

Commit acdaabc

Browse files
committed
fix(graphql): check for null data returned from fetchMore.updateQuery before writing to cache
1 parent be11b4c commit acdaabc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ Future<QueryResult<TParsed>> fetchMoreImplementation<TParsed>(
3434
final data = fetchMoreOptions.updateQuery(
3535
previousResult.data,
3636
fetchMoreResult.data,
37-
)!;
37+
);
3838

3939
fetchMoreResult.data = data;
4040

41-
if (originalOptions.fetchPolicy != FetchPolicy.noCache) {
41+
if (originalOptions.fetchPolicy != FetchPolicy.noCache && data != null) {
4242
queryManager.attemptCacheWriteFromClient(
4343
request,
4444
data,

0 commit comments

Comments
 (0)