Thank you for this nice article. I would like to add a few more things:
- In graphQL, we have an introspection query, which is really handy during development. (Don't forget to disable it in prod ð¥²).
- One of the lesser talked things about graphQL is data modelling. For Apollo cache to work efficiently, we must ensure that the data modelling is done nicely. If you ensure that you're not using any antipattern then usually it's safe. I've faced this issue earlier. (maybe I should document it? ð€)
- REST is faster: GraphQL does type checking, and all and thus they're slower than REST. But it makes the system less prone to errors. (There're tradeoffs to be made).
- Problem of N+1 queries: We might need to use the dataloader pattern to solve the N+1 issue, which is an additonal implementation overhead. Even after using dataloader pattern the number of queries needed to resolve one request will be greater than one simple query we need to write in REST. But do note that, the number of customized endpoints are less in graphQL, and we've granular control over data fetching, which are few pros.