dlbnco / tripby.org

Harm reduction info about psychoactive drugs with data provided by PsychonautWiki.org
https://tripby.org
23 stars 3 forks source link

Migrate from Apollo to React Query and statically generate page props #102

Closed dlbnco closed 3 years ago

dlbnco commented 3 years ago

There are just 4 queries in the entire app and Apollo is probably overkill for this. React Query has the same caching and lifecycle utilities while being probably more straightforward to integrate with data fetching in Next.js.

We should probably use getStaticProps in pages to save requests to the PsychonautWiki API and also function invocations on Vercel. The wiki data doesn't update that often, and 1 day or even more should be a good revalidate period.