Create Gatsby sites using GraphQL on Postgres
TL;DR: Source data from your existing postgres database for your gatsby site. Instant setup. Tutorial/boilerplate -> gatsby-postgres-graphql
Gatsby is an amazing framework to help you build statically rendered react sites. Static sites, like those built with Gatsby, are easy to deploy and scale using CDNs and provide users with an amazing experience because pages load “blazing fast”.
In some cases though, the data you need for your Gatsby site might come from a database, which it probably will in many real-world scenarios.
For example, in a recent conversation with David Eads, he told me that while Gatsby was being used effectively at ProPublica Illinois, there’s been a pain-point in integrating some of large datasets (on Postgres) they work with.
But, those days are now gone because:
- You can use the amazing gatsby-source-graphql plugin to set any GraphQL API as a gatsby data-source
- You can use Hasura to expose an existing Postgres database over GraphQL instantly
Karthik Venkateswaran has put together a neat little boilerplate and tutorial so that you can get started quickly!