Skip to content

Commit

Permalink
fix(graphql): check for null data returned from fetchMore.updateQuery…
Browse files Browse the repository at this point in the history
… before writing to cache
  • Loading branch information
aarsham committed Apr 8, 2024
1 parent be11b4c commit acdaabc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/graphql/lib/src/core/fetch_more.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ Future<QueryResult<TParsed>> fetchMoreImplementation<TParsed>(
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,
Expand Down

0 comments on commit acdaabc

Please # to comment.