Maxence POUTORD
GET /speaker/maxpou HTTP/1.1
{
"name": "Maxence POUTORD",
"skills": ["Symfony", "API", "NodeJS", "Software quality"],
"hobbies": ["motorbike", "cinema (Danish)", "cooking"],
"job": {
"job": "web consultant",
"company": "Conserto"
},
"_links": {
"self": { "href": "maxpou.fr/slides/slides/graphql-falcor-why-killing-rest/" },
"blog": { "href": "maxpou.fr" },
"Twitter": { "href": "twitter.com/_maxpou" },
"mail": { "href": "maxence.poutord@gmail.com" }
}
}
I will NOT speak about WHAT, only about WHY
GET/POST whatever...
Pros:
Cons:
The Hunt
2012
The Hunt
2012
Mads Mikkelsen
Thomas Bo Larsen
3 request to satisfy datas needed by view!
Pros:
Cons:
“One Model Everywhere”
# Request
GET /model.json?paths=["film.name", "film.year", "film.actor.name"]
# Response
{
user: {
name: "The Hunt",
year: 2012,
actor: [
{
"name": "Mads Mikkelsen"
},
{
"name": "Thomas Bo Larsen"
}
]
}
}
GET /graphql?query=
{
film(id: "12345") {
name,
year,
actor: {
name
}
}
}
{
"data": {
"film": {
"name": "The Hunt",
"year": "2012",
"actor": [
{
"name": "Mads Mikkelsen"
},
{
"name": "Thomas Bo Larsen"
}
]
}
}
}
REST | Falcor | GraphQL | |
Learning curve | ~ | ||
"Multi-GET" | |||
Message size | |||
Cache management | |||
Languages | |||
Introspection | |||
Possibility | |||
Community |