Skip to content

Relationship between data existence guarantees in useSuspenseQuery and the select option #7796

Answered by TkDodo
flex-kwoncheol asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the example.

it's wrapped in a try/catch that catches the error and then subsequently sets the query state to error:

if (this.#selectError) {
error = this.#selectError as any
data = this.#selectResult
errorUpdatedAt = Date.now()
status = 'error'
}

error boundary handling is done on component level, so it should work the same as if the queryFn returned a rejected promise.


So I looked into it a bit and found out what the problem is. select runs on observer level - each useQuery instance can have its own transformation. In your scenario, the query itself that is s…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@flex-kwoncheol
Comment options

@flex-kwoncheol
Comment options

@TkDodo
Comment options

Answer selected by flex-kwoncheol
@flex-kwoncheol
Comment options

@teogeos
Comment options

@TkDodo
Comment options

@teogeos
Comment options

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