queryClient.setQueryDefaults('user', {enabled:true}) not working? #3255
Unanswered
tamis-laan
asked this question in
Q&A
Replies: 1 comment
-
a "default" is a value that is taken when you don't provide one. It's a bit like object merging:
since you provide
which would yield |
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.
-
I'm experimenting with authentication and I have two mutations useLogin and useLogout aswel as a query useUser which returns the user object.
The user object should be undefined when not logged in and defined when loged in. Also the user object should not be fetched when logged out.
User query
Login mutation
I would expect after using the useLogin hook that the useUser hook wil start fetching the user object as it has been set to
enabled:true
using the setQueryDefaults method.However this is not the case...
Is there something I'm not understanding here, or is this a bug?
Beta Was this translation helpful? Give feedback.
All reactions