Introduction
PostGraphile (formerly PostGraphQL) builds a powerful, extensible and performant GraphQL API from a PostgreSQL schema in seconds; saving you weeks if not months of development time.
If you already use PostgreSQL then you understand the value that a strongly typed and well defined schema can bring to application development; GraphQL is the perfect match for this technology when it comes to making your data layer accessible to your frontend application developers (or even API clients). Why duplicate your authorization and business logic in a custom API when you can leverage the tried and tested capabilities built into the worlds most advanced open source database?
If you are new to GraphQL then we recommend you read through the official introduction to GraphQL here before continuing through the PostGraphile documentation.
By combining powerful features such as PostgreSQL's role-based grant system and row-level security policies with Graphile Engine's advanced GraphQL look-ahead and plugin expansion technologies, PostGraphile ensures your generated schema is secure, performant and extensible.
Some of the features we offer:
- Incredible performance - no N+1 query issues
- Extensibility via schema and server plugins
- Auto-discovered relations e.g.
userByAuthorId
- Computed columns allowing easy expansion of your API
- Custom query procedures enabling arbitrary SQL queries
- Automatic CRUD mutations e.g.
updatePost
- Custom mutation procedures enabling complex changes to be exposed simply
- Real-time features powered by LISTEN/NOTIFY and/or logical decoding
The easiest way to get started is with the
CLI interface; if you have npx
installed you can
try it out with:
npx postgraphile -c 'postgres://user:pass@localhost/mydb' --watch --enhance-graphiql --dynamic-json
(replacing user, pass and mydb with your PostgreSQL username, password and the name of your database)