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.


Hasura is an open-source engine that gives you realtime GraphQL APIs on new or existing Postgres databases, with built-in support for stitching custom GraphQL APIs and triggering webhooks on database changes.


Tanmai Gopal

Tanmai Gopal

Tanmai is the co-founder of hasura.io. He is a StackOverflow powered fullstack developer and is passionate about making it easier to build things.

Read More