News for hackers. Stuff that matters.
Re:The quiet, pervasive devaluation of front end by klysm on Friday March 08, 2024 @09:54AM (#39641564)
This is something I struggle with a lot in API design. If the frontend is to never join, then the backend has to provide either: 1. a very dynamic API (e.g. GraphQL) and support arbitrary queries 2. a static but 'bloated' API where every query joins in too much data to cover every use case 3. a static but 'wide' API where each use case gets its own specially crafted response

I have no good answer for what makes sense but I usually straddle 2 and 3.

Re:The quiet, pervasive devaluation of front end by solarkraft on Friday March 08, 2024 @10:17AM (#39641783)
If GraphQL was actually a query language (as in: allowing you to change the result set, not only the result shape), maybe 1 would be easily possible. Intuitively I would like that.

3 seems to be the most pragmatic option to me when you have good control over each side.

Re:The quiet, pervasive devaluation of front end by qazxcvbnm on Friday March 08, 2024 @12:52PM (#39643674)
Can you elaborate on what you mean by changing the result set as opposed to the shape?
Re:The quiet, pervasive devaluation of front end by klysm on Friday March 08, 2024 @10:30AM (#39641936)
Supporting the interface of graphql from the backend though is usually not very easy - you usually end up with a half baked database implementation that wraps a better database
Re:The quiet, pervasive devaluation of front end by nicwolff on Friday March 08, 2024 @02:10PM (#39644908)
Huh? GraphQL field arguments are used to filter and paginate result sets.
Re:The quiet, pervasive devaluation of front end by dustingetz on Friday March 08, 2024 @01:47PM (#39644490)
this is the problem electric clojure solves: https://github.com/hyperfiddle/electric
Re:The quiet, pervasive devaluation of front end by DanielHB on Friday March 08, 2024 @08:27PM (#39648546)
It depends a lot on the product, how wide and deep your API is and the division of labor. Like are frontend and backend separate teams? do people do full stack?

At some point there will be a need for some "bloated" API requests. GraphQL can help minimize how many of those you need.