SlideShare a Scribd company logo
GraphQL ♥ Graph Database
15/03/2018
Marco Liberati
@dej611
Enrico Risa
@wolf4ood
Agenda
- GraphQL Introduction
- GraphQL Schema Definition (Meetup)
- Why GraphQL ♥ Graph Database?
- Schema Impl with a GraphDB
WHY GRAPHQL?
Let’s Talk About Rest first
● Resource Based
● HTTP Verbs
○ GET
○ PUT
○ PATCH
○ DELETE
○ POST
Actions -> Verbs + Uris
Meetup model with REST
● https://api.meetup.com/:urlname
● https://api.meetup.com/:urlname/members
● https://api.meetup.com/:urlname/events
● https://api.meetup.com/:urlname/events/:event_id/rsvp
Sounds Cool, Let’s Use it
Multiple Round Trips Problem
How Do we Handle That?
GET /GraphRM?fields=topics
…And What about Over-fetching?
GET /GraphRM?only=id,name
I need only those fields
You will probably end up with some custom
endpoints
API Documentation
● How can i use those APIs ?
● What parameters this endpoint support?
● Is this parameter required?
● Swagger
● JSON Schema
● JSON:API
● API Blueprint
Documentation should be good in order to let
people use our APIs without headache
Potential Problems
● Multiple Round trips
● Over/Under fetching
● Documentation
What GraphQL IS NOT..
● A query language for Graph Databases
● Database / Storage Engine
● A library
● It’s not language specific
What Is IT ?
GraphQL is a query language for APIs and a runtime for fulfilling those queries
with your existing data. GraphQL provides a complete and understandable
description of the data in your API, gives clients the power to ask for exactly what
they need and nothing more, makes it easier to evolve APIs over time, and
enables powerful developer tools.
Just a spec
● A declarative query language
● A type system
● A runtime that fetch and mutate data
Hello GraphQL
Hello GraphQL (with nesting)
How does it work ?
● The server describe what is possible (a type system)
● The client can asks exactly what data it requires
● The server then gives back results with the same shape as the query
Power to the client
Powerful Type System
● Hierarchical
● Strongly-Typed
● Self Documenting
● Enable Introspection
● Client-specified queries
Types
● Objects
● Scalar
○ Boolean
○ Int
○ Float
○ String
○ Custom Types
● Enums
● Lists
● Unions
● Interfaces
GraphQL Schema Language
● GraphQL type system
● Describes what data can be queried
● Language-agnostic
GraphQL Schema Language Example
Mutation
Introspection
… Enables Tools
● GraphiQL
● Documentation
● IDE plugins
● Code generation
● Client Side Validation
● …
GraphQL Schema Definition (Meetup)
● Entity
○ User
○ Meetup
○ Tag
○ Event
● Query
○ meetupsByName
○ usersByName
GraphQL Schema Definition (Meetup)
Demo time!
https://github.com/GraphRM/graphql-graphdb
Why GraphQL ♥ Graph Database?
A GraphQL query represents a description of a relationship:
Why GraphQL ♥ Graph Database?
Person “me”
:id
:name
Person
:name
Person
:name
A GraphQL query represents a description of a relationship:
Why GraphQL ♥ Graph Database?
Person “me”
:id
:name
Person
:name
Person
:name
Problem:
● For each Person the GraphQL
reducer will go to the database and
ask for data.
● This is known as the N+1 query
problem.
● Which in turns mean poor
performance
What if we could translate one GraphQL query to a single GraphDB query?
Why GraphQL ♥ Graph Database?
● This could prevent the N+1 queries problem
● A GraphDB is designed to run traversals
● Bonus: if the schema is the same for both GraphQL and DB that is a
huge win!
What if we could translate one GraphQL query to a single GraphDB query?
Why GraphQL ♥ Graph Database?
What if we could translate one GraphQL query to a single GraphDB query?
Why GraphQL ♥ Graph Database?
What if we could translate one GraphQL query to a single GraphDB query?
Why GraphQL ♥ Graph Database?
● This is still a PoC but the idea is:
○ Parse the Schema and the query
○ Traverse the query and build a database query
What if we could translate one GraphQL query to a single GraphDB query?
Why GraphQL ♥ Graph Database?
This is not fully compatible yet but there are some PoC:
● GraphQL -> Neo4J Cypher:
https://github.com/neo4j-graphql/neo4j-graphql-js
● GraphQL -> OrientDB Gremlin + MATCH
https://github.com/kensho-technologies/graphql-compiler
What if we could translate one GraphQL query to a single GraphDB query?
Why GraphQL ♥ Graph Database?
Demo time!
https://github.com/GraphRM/graphql-graphdb
Grazie :)
Resources
● GraphQL: http://graphql.org/learn/
● AST Explorer: https://astexplorer.net/
● GRANDstack: https://grandstack.io/
● GraphQL + OrientDB:
https://blog.kensho.com/compiled-graphql-as-a-database-query-language-72e1
06844282
● GraphQL + Neo4J: https://neo4j.com/developer/graphql/
● Five common pitfalls with GraphQL and how Neo4J-GraphQL aims to solve
them:
https://blog.grandstack.io/five-common-graphql-problems-and-how-neo4j-graph
ql-aims-to-solve-them-e9a8999c8d43

More Related Content

What's hot

Kafka as your Data Lake - is it Feasible?
Kafka as your Data Lake - is it Feasible?Kafka as your Data Lake - is it Feasible?
Kafka as your Data Lake - is it Feasible?
Guido Schmutz
 
Performance Optimizations in Apache Impala
Performance Optimizations in Apache ImpalaPerformance Optimizations in Apache Impala
Performance Optimizations in Apache Impala
Cloudera, Inc.
 
Hive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep DiveHive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep Dive
DataWorks Summit
 

What's hot (20)

Pinot: Near Realtime Analytics @ Uber
Pinot: Near Realtime Analytics @ UberPinot: Near Realtime Analytics @ Uber
Pinot: Near Realtime Analytics @ Uber
 
Apache Calcite: One Frontend to Rule Them All
Apache Calcite: One Frontend to Rule Them AllApache Calcite: One Frontend to Rule Them All
Apache Calcite: One Frontend to Rule Them All
 
Pinot: Enabling Real-time Analytics Applications @ LinkedIn's Scale
Pinot: Enabling Real-time Analytics Applications @ LinkedIn's ScalePinot: Enabling Real-time Analytics Applications @ LinkedIn's Scale
Pinot: Enabling Real-time Analytics Applications @ LinkedIn's Scale
 
Google BigQuery
Google BigQueryGoogle BigQuery
Google BigQuery
 
Data lineage and observability with Marquez - subsurface 2020
Data lineage and observability with Marquez - subsurface 2020Data lineage and observability with Marquez - subsurface 2020
Data lineage and observability with Marquez - subsurface 2020
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
 
ACID ORC, Iceberg, and Delta Lake—An Overview of Table Formats for Large Scal...
ACID ORC, Iceberg, and Delta Lake—An Overview of Table Formats for Large Scal...ACID ORC, Iceberg, and Delta Lake—An Overview of Table Formats for Large Scal...
ACID ORC, Iceberg, and Delta Lake—An Overview of Table Formats for Large Scal...
 
Apache Spark 2.4 and 3.0 What's Next?
Apache Spark 2.4 and 3.0  What's Next? Apache Spark 2.4 and 3.0  What's Next?
Apache Spark 2.4 and 3.0 What's Next?
 
Kafka as your Data Lake - is it Feasible?
Kafka as your Data Lake - is it Feasible?Kafka as your Data Lake - is it Feasible?
Kafka as your Data Lake - is it Feasible?
 
Apache Atlasの現状とデータガバナンス事例 #hadoopreading
Apache Atlasの現状とデータガバナンス事例 #hadoopreadingApache Atlasの現状とデータガバナンス事例 #hadoopreading
Apache Atlasの現状とデータガバナンス事例 #hadoopreading
 
Migrating Oracle to PostgreSQL
Migrating Oracle to PostgreSQLMigrating Oracle to PostgreSQL
Migrating Oracle to PostgreSQL
 
Using ClickHouse for Experimentation
Using ClickHouse for ExperimentationUsing ClickHouse for Experimentation
Using ClickHouse for Experimentation
 
Apache Airflow
Apache AirflowApache Airflow
Apache Airflow
 
Spark with Delta Lake
Spark with Delta LakeSpark with Delta Lake
Spark with Delta Lake
 
Performance Optimizations in Apache Impala
Performance Optimizations in Apache ImpalaPerformance Optimizations in Apache Impala
Performance Optimizations in Apache Impala
 
Data all over the place! How SQL and Apache Calcite bring sanity to streaming...
Data all over the place! How SQL and Apache Calcite bring sanity to streaming...Data all over the place! How SQL and Apache Calcite bring sanity to streaming...
Data all over the place! How SQL and Apache Calcite bring sanity to streaming...
 
BigQuery walk through.pptx
BigQuery walk through.pptxBigQuery walk through.pptx
BigQuery walk through.pptx
 
Hive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep DiveHive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep Dive
 
Big query
Big queryBig query
Big query
 
Making Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeMaking Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta Lake
 

Similar to GraphQL ♥︎ GraphDB

Training Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL LibraryTraining Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL Library
Neo4j
 

Similar to GraphQL ♥︎ GraphDB (20)

GraphQL Bangkok meetup 5.0
GraphQL Bangkok meetup 5.0GraphQL Bangkok meetup 5.0
GraphQL Bangkok meetup 5.0
 
Kotlin REST & GraphQL API
Kotlin REST & GraphQL APIKotlin REST & GraphQL API
Kotlin REST & GraphQL API
 
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay
 
GraphQL API Crafts presentation
GraphQL API Crafts presentationGraphQL API Crafts presentation
GraphQL API Crafts presentation
 
Modular GraphQL with Schema Stitching
Modular GraphQL with Schema StitchingModular GraphQL with Schema Stitching
Modular GraphQL with Schema Stitching
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
 
Building Fullstack Serverless GraphQL APIs In The Cloud
Building Fullstack Serverless GraphQL APIs In The CloudBuilding Fullstack Serverless GraphQL APIs In The Cloud
Building Fullstack Serverless GraphQL APIs In The Cloud
 
Training Week: GraphQL 2022
Training Week: GraphQL 2022Training Week: GraphQL 2022
Training Week: GraphQL 2022
 
Green Custard Friday Talk 8: GraphQL
Green Custard Friday Talk 8: GraphQLGreen Custard Friday Talk 8: GraphQL
Green Custard Friday Talk 8: GraphQL
 
Introduction to Graph QL
Introduction to Graph QLIntroduction to Graph QL
Introduction to Graph QL
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHP
 
Getting Started with Spring for GraphQL
Getting Started with Spring for GraphQLGetting Started with Spring for GraphQL
Getting Started with Spring for GraphQL
 
Training Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL LibraryTraining Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL Library
 
REST vs GraphQL
REST vs GraphQLREST vs GraphQL
REST vs GraphQL
 
GraphQL (Graphene-Django)
GraphQL (Graphene-Django)GraphQL (Graphene-Django)
GraphQL (Graphene-Django)
 
Elixir absinthe-basics
Elixir absinthe-basicsElixir absinthe-basics
Elixir absinthe-basics
 
Attacking GraphQL
Attacking GraphQLAttacking GraphQL
Attacking GraphQL
 
GraphQL @ Manc.JS (March 2018)
GraphQL @ Manc.JS (March 2018)GraphQL @ Manc.JS (March 2018)
GraphQL @ Manc.JS (March 2018)
 
PHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLitePHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLite
 

More from GraphRM

More from GraphRM (14)

A gentle introduction to random and strategic networks
A gentle introduction to random and strategic networksA gentle introduction to random and strategic networks
A gentle introduction to random and strategic networks
 
How to leverage Kafka data streams with Neo4j
How to leverage Kafka data streams with Neo4jHow to leverage Kafka data streams with Neo4j
How to leverage Kafka data streams with Neo4j
 
From zero to gremlin hero - Part I
From zero to gremlin hero - Part IFrom zero to gremlin hero - Part I
From zero to gremlin hero - Part I
 
Topology Visualization at Sysdig
Topology Visualization at SysdigTopology Visualization at Sysdig
Topology Visualization at Sysdig
 
Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...
Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...
Tecniche per la Visualizzazione di Grafi di Grandi Dimensioni Basate sulla Co...
 
aRangodb, un package per l'utilizzo di ArangoDB con R
aRangodb, un package per l'utilizzo di ArangoDB con RaRangodb, un package per l'utilizzo di ArangoDB con R
aRangodb, un package per l'utilizzo di ArangoDB con R
 
The power of the cosmos in a DB .... CosmosDB
The power of the cosmos in a DB .... CosmosDBThe power of the cosmos in a DB .... CosmosDB
The power of the cosmos in a DB .... CosmosDB
 
OrientDB graph e l'importanza di una relazione mancante
OrientDB graph e l'importanza di una relazione mancanteOrientDB graph e l'importanza di una relazione mancante
OrientDB graph e l'importanza di una relazione mancante
 
Il "Knowledge Graph" della Pubblica Amministrazione Italiana
Il "Knowledge Graph" della Pubblica Amministrazione ItalianaIl "Knowledge Graph" della Pubblica Amministrazione Italiana
Il "Knowledge Graph" della Pubblica Amministrazione Italiana
 
Elastic loves Graphs
Elastic loves GraphsElastic loves Graphs
Elastic loves Graphs
 
From text to entities: Information Extraction in the Era of Knowledge Graphs
From text to entities: Information Extraction in the Era of Knowledge GraphsFrom text to entities: Information Extraction in the Era of Knowledge Graphs
From text to entities: Information Extraction in the Era of Knowledge Graphs
 
Graph analysis over relational database
Graph analysis over relational databaseGraph analysis over relational database
Graph analysis over relational database
 
GraphRM - Introduzione al Graph modelling
GraphRM  - Introduzione al Graph modellingGraphRM  - Introduzione al Graph modelling
GraphRM - Introduzione al Graph modelling
 
Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018
Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018
Costruiamo un motore di raccomandazione con Neo4J - Workshop 25/1/2018
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 

GraphQL ♥︎ GraphDB

  • 1. GraphQL ♥ Graph Database 15/03/2018
  • 3. Agenda - GraphQL Introduction - GraphQL Schema Definition (Meetup) - Why GraphQL ♥ Graph Database? - Schema Impl with a GraphDB
  • 5. Let’s Talk About Rest first ● Resource Based ● HTTP Verbs ○ GET ○ PUT ○ PATCH ○ DELETE ○ POST Actions -> Verbs + Uris
  • 6. Meetup model with REST ● https://api.meetup.com/:urlname ● https://api.meetup.com/:urlname/members ● https://api.meetup.com/:urlname/events ● https://api.meetup.com/:urlname/events/:event_id/rsvp
  • 9. How Do we Handle That? GET /GraphRM?fields=topics
  • 10. …And What about Over-fetching? GET /GraphRM?only=id,name I need only those fields
  • 11. You will probably end up with some custom endpoints
  • 12. API Documentation ● How can i use those APIs ? ● What parameters this endpoint support? ● Is this parameter required? ● Swagger ● JSON Schema ● JSON:API ● API Blueprint Documentation should be good in order to let people use our APIs without headache
  • 13. Potential Problems ● Multiple Round trips ● Over/Under fetching ● Documentation
  • 14.
  • 15. What GraphQL IS NOT.. ● A query language for Graph Databases ● Database / Storage Engine ● A library ● It’s not language specific
  • 16. What Is IT ? GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
  • 17. Just a spec ● A declarative query language ● A type system ● A runtime that fetch and mutate data
  • 20. How does it work ? ● The server describe what is possible (a type system) ● The client can asks exactly what data it requires ● The server then gives back results with the same shape as the query Power to the client
  • 21. Powerful Type System ● Hierarchical ● Strongly-Typed ● Self Documenting ● Enable Introspection ● Client-specified queries
  • 22. Types ● Objects ● Scalar ○ Boolean ○ Int ○ Float ○ String ○ Custom Types ● Enums ● Lists ● Unions ● Interfaces
  • 23. GraphQL Schema Language ● GraphQL type system ● Describes what data can be queried ● Language-agnostic
  • 27. … Enables Tools ● GraphiQL ● Documentation ● IDE plugins ● Code generation ● Client Side Validation ● …
  • 28. GraphQL Schema Definition (Meetup) ● Entity ○ User ○ Meetup ○ Tag ○ Event ● Query ○ meetupsByName ○ usersByName
  • 29. GraphQL Schema Definition (Meetup) Demo time! https://github.com/GraphRM/graphql-graphdb
  • 30. Why GraphQL ♥ Graph Database?
  • 31. A GraphQL query represents a description of a relationship: Why GraphQL ♥ Graph Database? Person “me” :id :name Person :name Person :name
  • 32. A GraphQL query represents a description of a relationship: Why GraphQL ♥ Graph Database? Person “me” :id :name Person :name Person :name Problem: ● For each Person the GraphQL reducer will go to the database and ask for data. ● This is known as the N+1 query problem. ● Which in turns mean poor performance
  • 33. What if we could translate one GraphQL query to a single GraphDB query? Why GraphQL ♥ Graph Database? ● This could prevent the N+1 queries problem ● A GraphDB is designed to run traversals ● Bonus: if the schema is the same for both GraphQL and DB that is a huge win!
  • 34. What if we could translate one GraphQL query to a single GraphDB query? Why GraphQL ♥ Graph Database?
  • 35. What if we could translate one GraphQL query to a single GraphDB query? Why GraphQL ♥ Graph Database?
  • 36. What if we could translate one GraphQL query to a single GraphDB query? Why GraphQL ♥ Graph Database? ● This is still a PoC but the idea is: ○ Parse the Schema and the query ○ Traverse the query and build a database query
  • 37. What if we could translate one GraphQL query to a single GraphDB query? Why GraphQL ♥ Graph Database? This is not fully compatible yet but there are some PoC: ● GraphQL -> Neo4J Cypher: https://github.com/neo4j-graphql/neo4j-graphql-js ● GraphQL -> OrientDB Gremlin + MATCH https://github.com/kensho-technologies/graphql-compiler
  • 38. What if we could translate one GraphQL query to a single GraphDB query? Why GraphQL ♥ Graph Database? Demo time! https://github.com/GraphRM/graphql-graphdb
  • 40. Resources ● GraphQL: http://graphql.org/learn/ ● AST Explorer: https://astexplorer.net/ ● GRANDstack: https://grandstack.io/ ● GraphQL + OrientDB: https://blog.kensho.com/compiled-graphql-as-a-database-query-language-72e1 06844282 ● GraphQL + Neo4J: https://neo4j.com/developer/graphql/ ● Five common pitfalls with GraphQL and how Neo4J-GraphQL aims to solve them: https://blog.grandstack.io/five-common-graphql-problems-and-how-neo4j-graph ql-aims-to-solve-them-e9a8999c8d43