Skip to content

Commit

Permalink
Fix markMutationResult not to run refetchQueries when fetchPolicy ===…
Browse files Browse the repository at this point in the history
… 'no-cache' and mutation.refetchQueries is empty array (default argument)
  • Loading branch information
msand committed Sep 22, 2023
1 parent 770cb72 commit 17ddc0e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/QueryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,12 @@ export class QueryManager<TStore> {
}
}

const refetchQueries = mutation.refetchQueries;
if (
cacheWrites.length > 0 ||
mutation.refetchQueries ||
(skipCache
? refetchQueries?.length
: refetchQueries) ||
mutation.update ||
mutation.onQueryUpdated ||
mutation.removeOptimistic
Expand Down Expand Up @@ -545,7 +548,7 @@ export class QueryManager<TStore> {
}
},

include: mutation.refetchQueries,
include: refetchQueries,

// Write the final mutation.result to the root layer of the cache.
optimistic: false,
Expand Down

0 comments on commit 17ddc0e

Please sign in to comment.