{"id":16959441,"url":"https://github.com/ncrmro/postgres-graphql","last_synced_at":"2026-05-05T04:33:05.383Z","repository":{"id":48816275,"uuid":"334553113","full_name":"ncrmro/postgres-graphql","owner":"ncrmro","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-10T12:59:35.000Z","size":318,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T07:13:54.409Z","etag":null,"topics":["graphql","postgraphile","postgraphql","postgres","postgresql","sql"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ncrmro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-31T02:04:53.000Z","updated_at":"2021-07-10T12:59:38.000Z","dependencies_parsed_at":"2022-09-23T22:01:58.198Z","dependency_job_id":null,"html_url":"https://github.com/ncrmro/postgres-graphql","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrmro%2Fpostgres-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrmro%2Fpostgres-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrmro%2Fpostgres-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncrmro%2Fpostgres-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncrmro","download_url":"https://codeload.github.com/ncrmro/postgres-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244816219,"owners_count":20515060,"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":["graphql","postgraphile","postgraphql","postgres","postgresql","sql"],"created_at":"2024-10-13T22:44:58.189Z","updated_at":"2025-10-14T13:33:48.035Z","avatar_url":"https://github.com/ncrmro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postgres GraphQL\n\nThis is an example project using the following technologies to provide a GraphQL\nserver.\n\n- [Postgres](https://www.postgresql.org)\n- [PostGraphile](https://www.graphile.org)\n- [graphile-migrate](https://github.com/graphile/migrate)\n\nThe main benefit here is our GraphQL API types come directly from the Database,\nfurthermore in our frontend applications we can automatically generate\nTypescript Types and Typed requests to interact with our API improving\ndevelopment agility and our application's integrity.\n\nThis README contains the following sections.\n\n- [Getting Started](#getting-started)\n  - [Database](#database)\n    - [Schema and Migrations](#schema-and-migrations)\n  - [GraphQL](#graphql)\n    - [GraphiQL](#graphiql)\n\n## Getting Started\n\nThe only hard requirement is that you have `docker` and `docker-compose`\ninstalled, although naturally, you could install everything locally.\n\n### .env\n\nFirst, let's copy the `.env.example` to `.env`. This file used by\n`docker-compose` will pass these environment variables into designated\ncontainers.\n\n```bash\ncp .env.example .env\n```\n\n```bash\nsh ./init.sh\n```\n\n```bash\ndocker-compose up database migrations\n```\n\nWrite some migrations in `current.sql`, once you're ready to commit.\n\nNote I like to keep the minimum amount of logic in a specific commit to make\nyour schema easier to read in the future, this also keeps your agility up in\nregards to developing new features.\n\n```bash\ndocker-compose exec migrations yarn graphile-migrate commit -m \"my commit message\"\n```\n\nIf you need to reset the database and rerun committed migrations.\n\n```bash\ndocker-compose exec migrations yarn graphile-migrate reset --erase\n```\n\n### GraphQL\n\nOnce we have our database up and running with a schema we can go ahead and start\nthe GraphQL server.\n\n```bash\ndocker-compose up database migrations gql\n```\n\nOr using up without and other parameters would start all available\ndocker-compose services\n\n```bash\ndocker-compose up database migrations gql\n```\n\nNote that because GraphQL specifies migrations as a dependency and migrations\nspecify database as a dependency we could also start everything up with the\nfollowing command, although this would only output logs from the gql service\nhiding other crucial logs.\n\n```bash\ndocker-compose up database migrations gql\n```\n\n#### GraphiQL\n\nPostgraphile comes with a nifty interface to aid in development called GraphiQL,\nthis allows us to inspect our current GraphQL schema at the following URL.\n\n```\nhttp://localhost:5000/graphiql\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncrmro%2Fpostgres-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncrmro%2Fpostgres-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncrmro%2Fpostgres-graphql/lists"}