Skip to content
Discussion options

You must be logged in to vote

Does anyone know why we need different kind of parameters for each kind of observer?

They don't, these are just examples. You can setup an observer with only the queryKey - that's the only required argument. But if you don't have a queryFn set globally then, it will die. So mostly, you'll need queryKey + queryFn.

useInfiniteQuery mostly does nothing without getNextPageParam, and this will be required on type level in v5, as well as an additional defaultPageParam option. You can read about that changes here:


basically, options you pass to an Observer are the same as you'd pass to useQuery or useQueries / useInfiniteQuery in react, because the react hooks create observers.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@lgenzelis
Comment options

@TkDodo
Comment options

@lgenzelis
Comment options

Answer selected by lgenzelis
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