Episode 107 - GraphQL Pros and Cons, examples and when to use over REST - podcast episode cover

Episode 107 - GraphQL Pros and Cons, examples and when to use over REST

Sep 26, 201958 min
--:--
--:--
Download Metacast podcast app
Listen to this episode in Metacast mobile app
Don't just listen to podcasts. Learn from them with transcripts, summaries, and chapters for every episode. Skim, search, and bookmark insights. Learn more

Episode description

GraphQL Pros and Cons, examples and when to use over REST

GraphQL is an open source query language developed by facebook that allows clients to formulate queries to get different results. Its main goal is to combine multiple services into one endpoint. In this video we will discuss what is GraphQL, why facebook developed it, go through some examples using github GraphQL API, finally we will discuss the pros and cons and when you should use this technology.

  • What is GraphQL?
  • Examples
  • Pros and Cons
  • when to use REST vs GRAPHQL

What is GraphQL

  • Schema
  • Query language
  • Nesting
  • Mutation and subscription

Examples

Schema intro

Github API

Rest api

Pros

  • Flexibility
  • efficient response : payload back only get what you want of fields since you know the schema
  • No round trips- Avoiding multiple round trips (HATEOS REST)
  • Uniform single interface API endpoint
  • Self documenting

Cons

  • Complexity
  • Typed system - ( use it to know if a type is available or not and fork logic) slows down adoption.. same as soap
  • No Caching etag since always POST
  • Error management non-standard for HTTP.
  • Over engineering can lead to Inefficiency of the joins can lead to performance and DOS
For the best experience, listen in Metacast app for iOS or Android