using return value of useQuery as a queryKey
This obviously does not work since
data is used before its declaration.Is there a way to use
data.id as a queryKey? I fetch the user by cookie information, so don't need to use an id, but want to use its id as a queryKey, so that if I fetch a user with useGetUserById function, which accepts an id, then I would hit the cache instead of making a request for the data I already have.