You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module helps you pull your PostgreSQL database into Gatsby with minimal
effort.
Crowd-funded open-source software
To help us develop this software sustainably, we ask all individuals and
businesses that use it to help support its ongoing maintenance and development
via sponsorship.
module.exports={/* ... */plugins: [/* ... */{resolve: "gatsby-source-pg",options: {connectionString: "postgres://user:pass@host/dbname",schema: "public",refetchInterval: 60,// Refetch data every 60 seconds},},],};
The connectionString can be any valid PostgreSQL connection string, a full
connection string might look like:
postgres://pg_user:pg_pass@pg_host:pg_port/pg_db?ssl=1
In addition, we accept the typeName and fieldName options from
gatsby-source-graphql which affect how the schema is namespaced, and the
refetchInterval setting to trigger refetching data every X seconds.
A common thing you might want to do is to shorten the names that PostGraphile
uses by default, you can do this using a plugin such as
@graphile-contrib/pg-simplify-inflector: