WTF is GraphQL?

GraphQL logo

Introduction

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

@nikolasburk

Query

{
  movie(name: "Rango") {
    ratings
  }
}

Output

{
  "data": {
    "movie": {
      "ratings": ["10/10 - IGN"]
    }
  },
  "errors": { … }
}

How?

Why?

GraphQL enables the server developer to focus on describing the data available rather than implementing and optimizing specific endpoints.

@marktani

Who?

Facebook Open Source logo

Implementation

fetch('https://graphql-pokemon.now.sh/', {
  method: 'post',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    query: `{ pokemon(name: "Pikachu") { types } }`
  })
})

Please let me code

devhints.io/graphql

Conclusion

  1. graphql.org
  2. howtographql.com
  3. Conventions by Spotify