SlideShare a Scribd company logo
PostGraphQL
Creating a Relay compatible GraphQL

server without a line of coding
PostGraphQL
or why the shift key has become

the most used key on my keyboard
auto generated backends
GET /articles
GET /articles
GET /articles/123
GET /articles
GET /articles/123
PUT /articles
GET /articles
GET /articles/123
PUT /articles
GET /articles
GET /articles/123
PUT /articles
GET /authors/abc
GET /articles
GET /articles/123
PUT /articles
GET /authors/abc
PUT /subscriptions/tag
GET /articles
GET /articles/123
PUT /articles
GET /authors/abc
PUT /subscriptions/tag
GET /articles?version=mobile
GET /articles
GET /articles/123
PUT /articles
GET /authors/abc
PUT /subscriptions/tag
GET /articles?version=mobile
client defined queries
per field access control
pagable connections
predictable mutations
define data-model

not custom views
define permissions
not protected routes
define cursors
not custom pagination
standardised mutations
not individual CRUD operations
auto-generated
backends
postgraphql
postgreSQL express graphQL
+ =
A GraphQL schema created by
reflection over a PostgreSQL schema
define your data graph in postgres
define your business logic in postgres
define your access control in postgres
schema definition
articles categories
1 1
1
n
authors
articles categories
articles_authors
1 1
1
1
authors
1 1
id title
article1 Reederei Rickmers kündigt…
id article_id author_id
1 article1 author1
2 article1 author2
id name
author1 Daniel
author2 Marc
ready for take off
PostGraphQL server listening on port 5000 🚀
‣ Connected to Postgres instance postgres://localhost:5432
‣ Introspected Postgres schema(s) public
‣ GraphQL endpoint served at http://localhost:5000/graphql
‣ GraphiQL endpoint served at http://localhost:5000/graphiql
postgraphql --watch
yarn global add postgraphql
PostGraphQL
relay pagination
sorting
conditions
connections
mutations
auto generated delete, update and
create mutations for all tables
custom mutations possible
relay compatible
demo
access control
connectDB('root','root','localhost:5432')
limited access
client API database
full access
CREATE ROLE 'viewer';
GRANT SELECT ON articles TO viewer;
CREATE ROLE 'editor';
GRANT ALL ON articles TO editor;
CREATE ROLE 'viewer';
GRANT SELECT ON articles TO viewer;
limited access
client API database
scoped access
Header

JWT
{
aud: 'postgraphql',
role: 'editor'
}
mutation {
createArticle(…) {
article {
…
}
}
}
Body

GraphQL
query
query {
allArticles {
nodes {
…
}
}
}
Body

GraphQL
query
defaultRole = 'viewer'
CREATE ROLE 'editor';
GRANT ALL ON articles TO editor;
CREATE ROLE 'viewer';
GRANT SELECT ON articles TO viewer;
id title status
1 Reederei Rickmers kündigt… PUBLISHED
2 Trump will Entscheidung… DRAFT
3 Protest gegen Abschiebung… DEPUBLISHED
4 FC Bayern wird Deutscher… SCHEDULED
SET row_security = on;
CREATE POLICY published ON articles

FOR SELECT TO viewer

USING status = 'PUBLISHED';
computed properties
{
article {
id: '123'
shareURL: 'https://br24.de/123'
}
}
CREATE FUNCTION 

article_share_url(article articles) as $$

SELECT 'https://br24.de/' || article.id;

$$

LANGUAGE SQL STABLE;
{
searchArticles(term: "Merkel") {
edges {
node {
title
}
}
}
}
demo
even more postgres
JSON support
event triggers
full text search
geospatial information
PostGraphQL
@danielbuechele
=

More Related Content

PDF
logcat Hilt
PDF
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
PDF
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
PDF
GraphQL IndyJS April 2016
PDF
Implementing GraphQL - Without a Backend
PDF
Creating applications with Grails, Angular JS and Spring Security
PPTX
Taking Control of your Data with GraphQL
PDF
Mastering Grails 3 Plugins - GR8Conf EU 2016
logcat Hilt
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
GraphQL IndyJS April 2016
Implementing GraphQL - Without a Backend
Creating applications with Grails, Angular JS and Spring Security
Taking Control of your Data with GraphQL
Mastering Grails 3 Plugins - GR8Conf EU 2016

What's hot (20)

PPTX
Overview for device farm for mobile testing
ODP
Introduction to Swagger
PDF
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
PDF
GraphQL in an Age of REST
PDF
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
PDF
Who's afraid of front end databases
PDF
Mastering Grails 3 Plugins - GR8Conf US 2016
PDF
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
PDF
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
PDF
[제3회 스포카콘] Elasticsearch 동기화 개선을 위한 고군분투기
PDF
Afupday lille-2020
PDF
Aws Deployment Tools - Overview, Details, Implementation
PDF
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless
PDF
ServiceWorkerとES6 Modules時代のTypescript開発考察
PDF
London React August - GraphQL at The Financial Times - Viktor Charypar
PDF
The GrapQL ecosystem
PPTX
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
PDF
React vs angular (mobile first battle)
PDF
Improve monitoring and observability for kubernetes with oss tools
PPTX
Highload JavaScript Framework without Inheritance
Overview for device farm for mobile testing
Introduction to Swagger
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
GraphQL in an Age of REST
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
Who's afraid of front end databases
Mastering Grails 3 Plugins - GR8Conf US 2016
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
[제3회 스포카콘] Elasticsearch 동기화 개선을 위한 고군분투기
Afupday lille-2020
Aws Deployment Tools - Overview, Details, Implementation
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless
ServiceWorkerとES6 Modules時代のTypescript開発考察
London React August - GraphQL at The Financial Times - Viktor Charypar
The GrapQL ecosystem
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
React vs angular (mobile first battle)
Improve monitoring and observability for kubernetes with oss tools
Highload JavaScript Framework without Inheritance
Ad

Similar to PostGraphQL (20)

PPT
Pentest Application With GraphQL | Null Bangalore Meetup
PDF
Introduction to GraphQL for beginners
PPTX
Shift Remote: WEB - GraphQL and React – Quick Start - Dubravko Bogovic (Infobip)
PDF
GraphQL and Relay Modern
PDF
GraphQL And Relay Modern
PDF
GraphQL And Relay Modern
PDF
PHP, the GraphQL ecosystem and GraphQLite
PPTX
Introduction to GraphQL
PPTX
Introduction to Graph QL
PPTX
GraphQL API Crafts presentation
PDF
APIdays Paris 2018 - Secure & Manage APIs with GraphQL, Ozair Sheikh, Directo...
PDF
GraphQL Bangkok meetup 5.0
PDF
Building and deploying GraphQL Servers with AWS Lambda and Prisma I AWS Dev D...
PDF
GraphQL for Native Apps
PDF
Let's start GraphQL: structure, behavior, and architecture
PDF
20170624 GraphQL Presentation
PDF
Overview of GraphQL & Clients
PDF
GraphQL the holy contract between client and server
PDF
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
PDF
Testing and Developing GraphQL APIs
Pentest Application With GraphQL | Null Bangalore Meetup
Introduction to GraphQL for beginners
Shift Remote: WEB - GraphQL and React – Quick Start - Dubravko Bogovic (Infobip)
GraphQL and Relay Modern
GraphQL And Relay Modern
GraphQL And Relay Modern
PHP, the GraphQL ecosystem and GraphQLite
Introduction to GraphQL
Introduction to Graph QL
GraphQL API Crafts presentation
APIdays Paris 2018 - Secure & Manage APIs with GraphQL, Ozair Sheikh, Directo...
GraphQL Bangkok meetup 5.0
Building and deploying GraphQL Servers with AWS Lambda and Prisma I AWS Dev D...
GraphQL for Native Apps
Let's start GraphQL: structure, behavior, and architecture
20170624 GraphQL Presentation
Overview of GraphQL & Clients
GraphQL the holy contract between client and server
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
Testing and Developing GraphQL APIs
Ad

Recently uploaded (20)

PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
Tartificialntelligence_presentation.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Web App vs Mobile App What Should You Build First.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
A Presentation on Artificial Intelligence
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Hybrid model detection and classification of lung cancer
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Approach and Philosophy of On baking technology
PDF
project resource management chapter-09.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
TLE Review Electricity (Electricity).pptx
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
A comparative study of natural language inference in Swahili using monolingua...
Tartificialntelligence_presentation.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Web App vs Mobile App What Should You Build First.pdf
cloud_computing_Infrastucture_as_cloud_p
A Presentation on Artificial Intelligence
Programs and apps: productivity, graphics, security and other tools
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Hybrid model detection and classification of lung cancer
OMC Textile Division Presentation 2021.pptx
Approach and Philosophy of On baking technology
project resource management chapter-09.pdf
Getting Started with Data Integration: FME Form 101
Enhancing emotion recognition model for a student engagement use case through...
Unlocking AI with Model Context Protocol (MCP)
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
TLE Review Electricity (Electricity).pptx

PostGraphQL