Repository navigation
Why is the key passed to the query function? #242
|
In v1, the query function now accepts the entire query key as the argument. For array based query keys, this means they now have a first param of key. function fetchData(key, ...rest) {
...
}I'm not sure I entirely understand the use case for this, so I'm interested to know a bit more about why support for this was added and use cases this comes in handy for. Thanks! |
Replies: 5 comments
|
See #145 (comment) |
|
I did just realize that the override doesn't support TypeScript since the type defs don't know about the query params filter. So TypeScript consumers will be forced to add the extra param to their fetch functions. |
|
Or they could just use it and augment the type on their own. Just because the type isn't there yet doesn't mean you can't use it. |
|
@tannerlinsley Does |
|
Yes, all queries functions that use that signature support it, even |
See #145 (comment)
And there's a way to override this behavior - see #145 (comment)