-
Hi, I'd love to get some advice on the following: I have a global atom for the logged in user:
the data is fetched after login:
I'd like to incorporate the fetching logic into the I'm not sure how to get this right. The docs are not sufficient for me. I tried something like this:
but it loads forever (suspense fallback is not showing) and I'm not even using the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi! Thanks for using the lib. Hope @Aslemammad can help on this specific problem with Apollo as he developed jotai-apollo. |
Beta Was this translation helpful? Give feedback.
-
ok, thanks to 2 insights:
I figured it out. see: https://github.com/mzalevski/jotai-apollo export const currentCountryAtom = atom<Promise<Country>>((get) => {
return get(clientAtom)
.query<{ country: Country }>({ query: COUNTRY })
.then((result) => result.data.country);
}); thanks @dai-shi @Aslemammad |
Beta Was this translation helpful? Give feedback.
ok, thanks to 2 insights:
I figured it out. see: https://github.com/mzalevski/jotai-apollo
thanks @dai-shi @Aslemammad