Skip to content

Commit

Permalink
fix(concurrentMode): refetchOnMount now only considers non-placeholde…
Browse files Browse the repository at this point in the history
…r instances

Fixes #465
  • Loading branch information
tannerlinsley committed May 11, 2020
1 parent 83ced96 commit b02f8dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/useBaseQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export function useBaseQuery(queryKey, queryVariables, queryFn, config = {}) {
!query.wasPrefetched && // Don't double fetch for prefetched queries
!query.wasSuspended && // Don't double fetch for suspense
query.state.isStale && // Only refetch if stale
(getLatestConfig().refetchOnMount || query.instances.length === 1)
(getLatestConfig().refetchOnMount ||
query.instances.filter(d => !d.isPlaceholder).length === 1)
) {
refetch().catch(Console.error)
}
Expand Down

0 comments on commit b02f8dd

Please sign in to comment.