DEV Community

Discussion on: Is GraphQL the future of APIs?

Collapse
 
shadowimmage profile image
Chase Sawyer

GraphQL can be as complex or simple as you design it to be. The benefit is when you start getting into a situation where you have a very complex data model, say 20+ related tables. In this case, if you want to load and then modify a bunch of interrelated tables all in one network round-trip, a mutation can do that. And the return data can include all the potentially derivative changed data, IDs, etc. in the returned query which nicely keeps the client cache up to date.

Now, if I only had one or three tables or a NoSQL data back end, a REST API might be faster / simpler to implement.

Collapse
 
katylava profile image
katy lavallee

This is a really helpful answer, thank you.