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

The Backend Engineering Show with Hussein Nasser

Episode | Podcast

Date: Thu, 26 Sep 2019 04:35:07 GMT

<p>GraphQL Pros and Cons, examples and when to use over REST</p> <p>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.</p> <ul> <li>What is GraphQL?</li> <li>Examples</li> <li>Pros and Cons</li> <li>when to use REST vs GRAPHQL</li> </ul> <p>What is GraphQL</p> <ul> <li>Schema</li> <li>Query language</li> <li>Nesting</li> <li>Mutation and subscription</li> </ul> <p>Examples</p> <p>Schema intro</p> <p>Github API</p> <p>Rest api</p> <p>Pros</p> <ul> <li>Flexibility</li> <li>efficient response : payload back only get what you want of fields since you know the schema</li> <li>No round trips- Avoiding multiple round trips (HATEOS REST)</li> <li>Uniform single interface API endpoint</li> <li>Self documenting</li> </ul> <p>Cons</p> <ul> <li>Complexity</li> <li>Typed system - ( use it to know if a type is available or not and fork logic) slows down adoption.. same as soap</li> <li>No Caching etag since always POST</li> <li>Error management non-standard for HTTP.</li> <li>Over engineering can lead to Inefficiency of the joins can lead to performance and DOS</li> </ul>