The document discusses GraphQL, a query language for APIs, emphasizing its efficiency in handling data retrieval compared to RESTful approaches. It highlights the benefits of using GraphQL with graph databases, particularly in resolving performance issues like the n+1 query problem. Additionally, it provides insights into schema definitions, query capabilities, and available resources for further exploration.
Overview of the topic on GraphQL, its introduction, key speakers, and agenda for the presentation.
Discussion on REST APIs, resource-based approach, HTTP verbs, potential problems like multiple round trips and over-fetching, emphasizing the need for good API documentation.
Clarification on what GraphQL is, its specifications, structure of queries, and server-client interaction.
Insight into the powerful type system of GraphQL, types of data, schemas used in queries, and a demo explanation.
Exploration of GraphQL's advantages with graph databases, addressing issues of querying and performance, along with translation tools and PoC demonstrations.
Concluding thank you note and provision of additional resources for further learning on GraphQL and its applications.
API Documentation
● Howcan 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
What GraphQL ISNOT..
● 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
How does itwork ?
● 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
A GraphQL queryrepresents a description of a relationship:
Why GraphQL ♥ Graph Database?
Person “me”
:id
:name
Person
:name
Person
:name
32.
A GraphQL queryrepresents 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 wecould 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 wecould translate one GraphQL query to a single GraphDB query?
Why GraphQL ♥ Graph Database?
35.
What if wecould translate one GraphQL query to a single GraphDB query?
Why GraphQL ♥ Graph Database?
36.
What if wecould 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 wecould 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 wecould translate one GraphQL query to a single GraphDB query?
Why GraphQL ♥ Graph Database?
Demo time!
https://github.com/GraphRM/graphql-graphdb