T
TanStack3y ago
optimistic-gold

query Auth check combined with Mocks

I check with useQuery that user is Authored on server but, i also have functionality to turn on Mocks, which means user is always Auth (no need to check on server) So now i call Auth Query on app mount and store result in a Context. In the same page i am able to set Context Auth value to true if mock_mode is on. Instead, I want to access data stored in query in my other components. Need to omit storing Auth value in Context ? i mean if mock_mode is on, i wanna write to query state or something like that cons query = useQuery(..... ) useEffect ( if (mock_mode) query.isSuccessful = true which looks bad, maybe there is another approach ? do u get what i need?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?