Replies: 1 comment
-
I've opened a PR here to demonstrate the idea further: #2186 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I was wondering if I could request a feature for enforcing "strict" query keys, in the sense that the query key array should not contain any null or undefined values.
I was thinking there could be an option for
useQuery
that can be calledstrict
orstrictQueryKeys
, and if it'strue
, react-query will check the query key before any fetch attempt, and if the query key contains any null or undefined values, it will not fetch, or it will automatically set theenabled
option tofalse
.We have a fairly large codebase at my work, and we have a workaround for this, which was to create a wrapper around
useQuery
, calleduseStrictQuery
, but it would be nice if this was included in the lib natively.Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions