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
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
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