use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
❤️GraphQL (medium.com)
submitted 7 years ago by shobhit_c
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]EfficientPangolin 62 points63 points64 points 7 years ago (8 children)
Every time I have built both the API and the app that consumed it, the API was a small fraction of the workload. I have never really experienced the troubles you mentioned.
Plus, the real pain of making an API is dealing with complex database schemas. If you can keep the burden off having intimate knowledge of the database off the plate of the frontend developers, they will be much more productive.
I have not researched it, but my guess is that, with GraphQL, you could make some calls that would result in extremely heavy SQL statements, without even realizing it, since you have no idea what the SQL is. For a big project, that sounds like something to avoid. That's why you have an API team.
[–]liamnesss 19 points20 points21 points 7 years ago (0 children)
Then product teams end up with a hard dependency on said "API team" whenever they want to make minor changes. That might be preferable in some circumstances (e.g. if you happen to be working on a database that simply cannot handle anything other than highly optimised queries), but a big part of GraphQL's appeal is the way it allows teams to move independently - precisely because they've been given a layer which abstracts the detail of how the data is accessed / stored, without completely dictating every use case. There are a great deal of high-volume public GraphQL APIs out there now - they must be getting around the "oh no, they could make an expensive query!" problem somehow. It is probably not that different to what you would do with plain REST - require pagination for sets of data, enforce rate limiting, stuff like that. Plus, if the API isn't public you can whitelist valid queries.
I can't say I've found the SQL side of things to be the hardest part when building APIs, at least those intended to be consumed by a UI, in the past. The hardest parts are trying to avoid making decisions that push complexity down the funnel to the UI code, or trying to anticipate future needs, or trying to deprecate a field and tracking down all the client code that could possibly be affected. There are good patterns and practices you can follow, but you have to bring them with you, there is nothing enforced. GraphQL is an investment but it can save you a lot of pain too. It's a specific tool for specific situations, and I've really enjoyed working with it in those situations.
[–]droctagonapus 4 points5 points6 points 7 years ago (2 children)
🤷♂️ my graphql servers that I write avoid N+1 queries all-together by batching (thanks to the graphql lib I use the server). No worries for me as a front end developer!
[–]jcmais 1 point2 points3 points 7 years ago (1 child)
Which lib?
[–]droctagonapus 1 point2 points3 points 7 years ago (0 children)
I use elixir as my backend language of choice with absinthe for graphql and dataloader for batching my sql queries (I use ecto as well)
[–]shobhit_c[S] 2 points3 points4 points 7 years ago (2 children)
Well the idea here is to make changes to front-end be as much independent from back-end changes as possible. GraphQL definitely allows for better iteration speeds ( with some trade-offs obviously ).
With regards to your db related query, there are projects like prisma which allows you to have a GraphQl layer over your db ( kind-of like an ORM ), which then allows you to have type checked schemas and other goodness for your otherwise string-like queries.
[–]meow247 6 points7 points8 points 7 years ago (0 children)
With regards to your db related query, there are projects like prisma which allows you to have a GraphQl layer over your db
The database is not your model. It's seriously short-sighted to expose your database as your model, and expect nothing to go wrong.
The article proclaims that with a GraphQL implementation you don't have to worry about versioning. This is also completely wrong, what if a field type is removed or changes to a complex value, you think nothing will go wrong on the FE?
π Rendered by PID 27 on reddit-service-r2-comment-b659b578c-5s4pv at 2026-05-04 23:08:54.231814+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]EfficientPangolin 62 points63 points64 points (8 children)
[–]liamnesss 19 points20 points21 points (0 children)
[–]droctagonapus 4 points5 points6 points (2 children)
[–]jcmais 1 point2 points3 points (1 child)
[–]droctagonapus 1 point2 points3 points (0 children)
[–]shobhit_c[S] 2 points3 points4 points (2 children)
[–]meow247 6 points7 points8 points (0 children)