Skip to content
Discussion options

You must be logged in to vote

I guess you just want to loop over all pages and take the first one where a recommendation was found?

return queryClient.getQueryData(['recommendations', 'all'])?.pages
  .map(page => page.recommendations.find(p => p._id === id)
  .find(r => !!r)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AlexDring
Comment options

Answer selected by AlexDring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants