Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to GraphQL and comparison with REST

Introduction to GraphQL and comparison with REST

Avatar for Pavan Kumar Sunkara

Pavan Kumar Sunkara

July 11, 2017

Other Decks in Technology

Transcript

  1. GET /me { "name": "Pavan Kumar Sunkara", "email": "[email protected]", "twitter":

    "pksunkara", "github": "pksunkara", "speakerdeck": "pksunkara" } Introduction to GraphQL and comparison with REST 2
  2. REST » Over a protocol (e.g. HTTP) » Uses the

    interface (e.g. status code, content type) » Hypermedia controls (e.g. HATEOAS) Introduction to GraphQL and comparison with REST 3
  3. GET / [ { "id": 3, "topic": "GraphQL", "date": "Jul

    11, 2017" }, { "id": 2, "topic": "APIs", "date": "May 2, 2017" }, { "id": 1, "topic": "Vue.js", "date": "March 7, 2017" } ] Introduction to GraphQL and comparison with REST 4
  4. GET /meetup/3/talks [ { "id": 6, "start_at": "6:30 PM", "title":

    "Introduction to GraphQL", "speaker_id": 6, }, { "id": 7, "start_at": "7:00 PM", "title": "GraphQL in Kiwi.com", "speaker_id": 3, }, { "id": 8, "start_at": "8:00 PM", "title": "Building global GraphQL API", "speaker_id": 7, } ] Introduction to GraphQL and comparison with REST 5
  5. GET /speaker/6 { "id": 6, "name": "Pavan Kumar Sunkara" }

    Introduction to GraphQL and comparison with REST 6
  6. GET /meetup/3/talks [ { "id": 6, "start_at": "6:30 PM", "title":

    "Introduction to GraphQL", "speaker": { "id": "6", "name": "Pavan Kumar Sunkara" } }, ... ] Introduction to GraphQL and comparison with REST 8
  7. GET /meetup/3/talks [ { "id": 6, "start_at": "6:30 PM", "title":

    "Introduction to GraphQL", "speaker": { "id": "6", "name": "Pavan Kumar Sunkara", "photo": "/speaker/photo/6.png" } }, ... ] Introduction to GraphQL and comparison with REST 9
  8. GET /meetup/3/talks [ { "id": 6, "start_at": "6:30 PM", "title":

    "Introduction to GraphQL", "speaker": { "id": "6", "name": "Pavan Kumar Sunkara", "photo": "/speaker/photo/6.png", "photo_big": "/speaker/photo/6.big.png", "photo_small": "/speaker/photo/6.small.png" } }, ... ] Introduction to GraphQL and comparison with REST 10
  9. GET /meetup/3/talks [ { "id": 6, "start_at": "6:30 PM", "title":

    "Introduction to GraphQL", "description": "He talks about GraphQL", "speaker": { "id": "6", "name": "Pavan Kumar Sunkara", "description": "He works at Apiary", "photo": "/speaker/photo/6.png", "photo_big": "/speaker/photo/6.big.png", "photo_small": "/speaker/photo/6.small.png", "github": "pksunkara", "twitter": "pksunkara" } }, ... ] Introduction to GraphQL and comparison with REST 11
  10. GraphQL » Hierarchial » Strongly typed » Single endpoint »

    Application layer protocol Introduction to GraphQL and comparison with REST 16