Skip to content

Commit

Permalink
hotfix(codegen): useAllObjects fix return field loading - stay false …
Browse files Browse the repository at this point in the history
…upon loading all pages (#5311)
  • Loading branch information
ekabardinsky authored Oct 3, 2024
1 parent 7cb4646 commit 09cde94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/codegen/generate.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,11 @@ export function generateReactHooks<
loadMore(data.length)
}, [count, data.length, error, fetchMoreError, firstPageLoaded, loadMore, skip])

const allDataLoaded = data.length === 0 ? objs.length === count : data.length === count
return {
loading,
allDataLoaded: data.length === 0 ? objs.length === count : data.length === count,
loading: !allDataLoaded,
/** @deprecated use loading field instead */
allDataLoaded,
objs: data.length === 0 ? objs : data,
count,
error: error || fetchMoreError,
Expand Down

0 comments on commit 09cde94

Please sign in to comment.