Why do people hate GraphQL Im people There migh...
Why does everybody hate GraphQL? GraphQL is supposed to make everything simpler, but usually it ends up making things more complicated and impossible to debug. How so? With a typical RESTful API, when a client wants to get data from the backend, they make requests to various API endpoints to get exactly what they need. With GraphQL, there is only one API endpoint and the clients just request exactly what pieces of data they want to receive from that endpoint. I mean, that actually does sound simpler. It is a lot simpler on the front end, but that's just because we've moved all the complexity to the backend. We need resolvers for every field telling that endpoint exactly where information needs to come from every time. And now the front end doesn't know what services they're invoking when they select different variables. So it becomes very easy for them to use bad access patterns, which are very inefficient for our services. Okay, I see what you mean about just shifting that complexity to the backend, but are there any other downsides? Logging and debugging also become a lot more complex and expensive. We've just introduced another layer where now we have to trace requests all the way from the clients into the API through the resolvers and all the way to our backend requests. And the worst part is people on the front end wondering why their queries are slow and have no idea what backend service they're actually invoking.
Summary
The video critiques GraphQL for shifting complexity from the front end to the backend, making debugging and logging more difficult. It highlights inefficiencies in access patterns and the challenges of tracing requests.
Key Points
- GraphQL simplifies front-end requests but complicates the backend.
- One API endpoint requires resolvers for each data field.
- Front-end developers may use inefficient access patterns.
- Logging and debugging become more complex with GraphQL.
- Tracing requests from client to backend adds overhead.
Tags
Repurpose Ideas
- LinkedIn post: Pros and cons of GraphQL vs REST APIs
- Tweet: Key challenges when using GraphQL in projects
- Checklist: Best practices for debugging GraphQL APIs
Save videos. Search everything.
Build your personal library of inspiration. Find any quote, hook, or idea in seconds.
Create Free Account No credit card required