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:

  1. You can use the amazing gatsby-source-graphql plugin to set any GraphQL API as a gatsby data-source
  2. 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!

Check it out on github.

Take it for a spin and let us know what you think. If you have any questions or run into any trouble, feel free to reach out to us on twitter, github or on our discord server.

Blog
27 Sep, 2018
Email
Subscribe to stay up-to-date on all things Hasura. One newsletter, once a month.
Loading...
v3-pattern
Accelerate development and data access with radically reduced complexity.