Re:GraphQL Is a Trap?
by mb7733 on Friday May 06, 2022 @10:36AM
(#31285624)
Something is wrong here. The whole point of GQL is to serve things in exactly the format the front end wants. Even the other negative comments here mention how it is easy to use on the front end.
[ Parent
| on HN ]
Perhaps. But just consider that your sibling comments have suggested about 5 different middleware tools that all supposedly do some similar thing. So I may be wrong, but at least four other people are wrong too ;)
This is never the case, every time I use GQL, I always have to reshape the response. GQL only lets you declare the data you want, it does not let you declare the shape in which you want it.
Then that's a problem with the schema implementation and not necessarily a fault of GraphQL. The people implementing a GraphQL schema should be working very closely with the people working on the frontend and put a lot of importance on how they want to consume the data.
GraphQL schemas that basically just expose the data models 1:1 without considering the exact workflows the frontend needs is a terrible implementation and misuse of GraphQL. Might as well just expose the data using REST
Yup I agree. But this is often what happens imo. That level of cross collaboration seems naturally unlikely.
Re:GraphQL Is a Trap?
by cellar_door on Friday May 06, 2022 @06:15PM
(#31290122)
Unfortunately this is my experience as well. Generally it's a misalignment of priorities. Since the people writing the endpoint don't have to consume it, they just do whatever is easiest as quickly as possible. And often many are dismissive of frontend concerns when challenged.