Query/Mutations as nested record
Hello,
I'm trying to do something with my queries/mutation to describe my endpoints as a queries/mutations in a recursive record to use (and mostly reuse) in my code.
My problem stems from the portability error on typescript (also I don't think I have used the right types but this works well enough for now). I can't dumb down the types & remove genericity as it's key for the types to work well inside of
useQuery
& others.
I'm aware of the query factory lib but it's not really what I want.
here is a gist of what I did: https://gist.github.com/Njiallu/850c4ad8880d2ef6da75dcc52996dfc6Gist
Tanstack query linked options
Tanstack query linked options. GitHub Gist: instantly share code, notes, and snippets.
0 Replies