GraphQL and a "shot" of Absinthe Hex

What is GraphQL?

Who is behind GraphQL?

Queries

{
  conferences{
    id
    name
  }
}
{
  "data": {
    "conferences": [
      {
        "name": "ElixirConf",
        "id": "1"
      },
      {
        "name": "RubyConf",
        "id": "2"
      }
    ]
  }
}

Mutations

mutation createConference($name: String!){
  createConference(name: $name){
    name
    id
  }
}
{
  "data": {
    "createConference": {
      "name": "Ruby Conf",
      "id": "7"
    }
  }
}

Subscriptions

subscription {
  conferenceAdded(name: "ElixirConfEU") {
    content
  }
}
{
  "data": {
    "id": "7"
  }
}

Absinthe Hex

  • absinthe
  • absinthe-plug
  • absinthe-phoenix
  • absinthe-ecto
  • absinthe

Demo

Benefits and pitfalls of GraphQL

Resources

GraphQL and a "shot" of Absinthe Hex

By Łukasz Jankowski

GraphQL and a "shot" of Absinthe Hex

  • 181