– @nikolasburkGraphQL is particularly great for frontend developers since it completely eliminates many of the inconveniences and shortcomings that are experienced with REST APIs … Complexity is pushed to the server-side …
{
movie(name: "Rango") {
ratings
}
}
{
"data": {
"movie": {
"ratings": ["10/10 - IGN"]
}
},
"errors": { … }
}
– @marktaniGraphQL enables the server developer to focus on describing the data available rather than implementing and optimizing specific endpoints.
fetch('https://graphql-pokemon.now.sh/', {
method: 'post',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: `{ pokemon(name: "Pikachu") { types } }`
})
})