GraphQL x REST

MD
R
Markdown

Some insights / tooling between GraphQL and REST

GraphQL

query GetAllAuthors {
  author {
    id
    name
  }
}

Performance Problems

Countries and Cities table. (1:n)

GQL Standard flow: 1- fetch all countries 2- for each country cities, lookup/join each city

Total amount of queries: 1+c1+c2+...cn

GQL Data Loader Flow: 1- fetch all countries 2- Get all cities

Total amount of queries: 1+x

======================================================================================================================== REST

Routes /authors /authors/:id/posts /authors/:id/posts/:post_id/comments

Created on 8/16/2022