3 ms·
The main thing vs REST is that it fixes the 'overlapping data in resources' issue. Want a timeline of tweets? Well you'll also want avatars to display, and you
by nailer 9y ago
The main thing vs REST is that it fixes the 'overlapping data in resources' issue. Want a timeline of tweets? Well you'll also want avatars to display, and you probably don't want that in a separate resource (because of multiple requests), so both /tweets and /users/userid will give you avatar details. It's a bit messy.
In graphQL there's one resource and you query it to tell you what you want.
- philstu 9y agoHey! I cover that a bit ni a followup blog post :) https://blog.runscope.com/posts/you-might-not-need-graphql https://blog.runscope.com/posts/you-might-not-need-graphql tl;dr: maybe you want OData, JSON-API, or one of the many other standards or practices that solve this simple problem as their super-set of functionality on top of the networking principles of REST. Using GraphQL for this alone is rather nuclear, as you gain a lot with GraphQL but lose other stuff.
- nailer 9y agoWhat do you lose? I actually use REST ATM but interested in GraphQL for my next project.