{"id":13725018,"url":"https://github.com/graphile/gatsby-source-pg","last_synced_at":"2025-09-11T23:08:30.207Z","repository":{"id":38375947,"uuid":"155712488","full_name":"graphile/gatsby-source-pg","owner":"graphile","description":"PostgreSQL source for Gatsby, powered by PostGraphile","archived":false,"fork":false,"pushed_at":"2024-11-18T22:42:13.000Z","size":521,"stargazers_count":35,"open_issues_count":4,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T04:05:45.525Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Benjie"}},"created_at":"2018-11-01T12:35:34.000Z","updated_at":"2025-03-18T21:49:02.000Z","dependencies_parsed_at":"2023-11-07T14:49:41.930Z","dependency_job_id":"155fcc68-2206-4f85-beb9-0baac186158f","html_url":"https://github.com/graphile/gatsby-source-pg","commit_stats":{"total_commits":78,"total_committers":6,"mean_commits":13.0,"dds":0.641025641025641,"last_synced_commit":"3fe738b96c082b38dd567340f0e9a130ae1fad27"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphile%2Fgatsby-source-pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphile%2Fgatsby-source-pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphile%2Fgatsby-source-pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphile%2Fgatsby-source-pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphile","download_url":"https://codeload.github.com/graphile/gatsby-source-pg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601449,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:02:09.937Z","updated_at":"2025-09-11T23:08:30.188Z","avatar_url":"https://github.com/graphile.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Benjie"],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.graphile.org/postgraphile/\"\u003e\n    \u003cimg alt=\"PostGraphile\" src=\"https://www.graphile.org/images/postgraphile.optimized.svg\" width=\"60\" /\u003e\n  \u003c/a\u003e\n  \u003cimg alt=\"Graphile Heart\" src=\"https://www.graphile.org/images/graphile.optimized.svg\" width=\"60\" /\u003e\n  \u003ca href=\"https://www.gatsbyjs.org\"\u003e\n    \u003cimg alt=\"Gatsby\" src=\"https://www.gatsbyjs.com/Gatsby-Monogram.svg\" width=\"60\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n  gatsby-source-pg\n\u003c/h1\u003e\n\nThis module helps you pull your PostgreSQL database into Gatsby with minimal\neffort.\n\n\u003c!-- SPONSORS_BEGIN --\u003e\n\n## Crowd-funded open-source software\n\nTo help us develop this software sustainably, we ask all individuals and\nbusinesses that use it to help support its ongoing maintenance and development\nvia sponsorship.\n\n### [Click here to find out more about sponsors and sponsorship.](https://www.graphile.org/sponsor/)\n\nAnd please give some love to our featured sponsors 🤩:\n\n\u003ctable\u003e\u003ctr\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://www.the-guild.dev/\"\u003e\u003cimg src=\"https://graphile.org/images/sponsors/theguild.png\" width=\"90\" height=\"90\" alt=\"The Guild\" /\u003e\u003cbr /\u003eThe Guild\u003c/a\u003e *\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://gosteelhead.com/\"\u003e\u003cimg src=\"https://graphile.org/images/sponsors/steelhead.svg\" width=\"90\" height=\"90\" alt=\"Steelhead\" /\u003e\u003cbr /\u003eSteelhead\u003c/a\u003e *\u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n\u003cem\u003e\\* Sponsors the entire Graphile suite\u003c/em\u003e\n\n\u003c!-- SPONSORS_END --\u003e\n\n## Usage\n\nTo install:\n\n```\nyarn add gatsby-source-pg\n```\n\n(or `npm install --save gatsby-source-pg`)\n\nThen add the config to your `gatsby-config.js`:\n\n```js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    /* ... */\n\n    {\n      resolve: \"gatsby-source-pg\",\n      options: {\n        connectionString: \"postgres://user:pass@host/dbname\",\n        schema: \"public\",\n        refetchInterval: 60, // Refetch data every 60 seconds\n      },\n    },\n  ],\n};\n```\n\nThe `connectionString` can be any valid PostgreSQL connection string, a full\nconnection string might look like:\n`postgres://pg_user:pg_pass@pg_host:pg_port/pg_db?ssl=1`\n\n## How to query\n\n```graphql\n{\n  postgres {\n    allPostsList {\n      id\n      authorId\n      userByAuthorId {\n        id\n        username\n      }\n      title\n    }\n  }\n}\n```\n\n## Example\n\nFor a working example of `gatsby-source-pg`, see\n[gatsby-source-pg-example](https://github.com/graphile/gatsby-source-pg-example).\n\n## Thanks\n\nThis plugin uses\n[`gatsby-source-graphql`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-graphql#readme)\nto merge the PostGraphile GraphQL schema into Gatsby's.\n\n## Customising\n\nThis plugin is powered by PostGraphile, which is built on the highly flexible\nand customisable Graphile Engine.\n\nYou can add to `options` most of the\n[PostGraphile schema-only options](https://www.graphile.org/postgraphile/usage-schema/#api-createpostgraphileschemapgconfig-schemaname-options)\n\nIn addition, we accept the `typeName` and `fieldName` options from\n`gatsby-source-graphql` which affect how the schema is namespaced, and the\n`refetchInterval` setting to trigger refetching data every X seconds.\n\nA common thing you might want to do is to shorten the names that PostGraphile\nuses by default, you can do this using a plugin such as\n`@graphile-contrib/pg-simplify-inflector`:\n\n```js\n// gatsby-config.js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    /* ... */\n    {\n      resolve: \"gatsby-source-pg\",\n      options: {\n        connectionString: \"postgres:///mydb\",\n        schema: \"public\",\n\n        /* 👇 */\n        appendPlugins: [require(\"@graphile-contrib/pg-simplify-inflector\")],\n        /* 👆 */\n      },\n    },\n  ],\n};\n```\n\n## Getting help\n\nPop into the Graphile Discord:\n[http://discord.gg/graphile](http://discord.gg/graphile)\n\n## Helpful links\n\n- [Gatsby documentation](https://www.gatsbyjs.org/)\n- [gatsby-source-pg-example](https://github.com/graphile/gatsby-source-pg-example/)\n- [PostGraphile documentation](https://www.graphile.org/postgraphile/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphile%2Fgatsby-source-pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphile%2Fgatsby-source-pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphile%2Fgatsby-source-pg/lists"}