Hacker Newsnew | past | comments | ask | show | jobs | submit | roflyear's commentslogin

They have to compete against entities who really know what they are doing.


I do think that using graphql will solve a lot of problems for people but it's super surprising how many people absolutely hate it.


GraphQL is just a typed schema (good) with a server capable of serving any subset of the entire schema at a time (pain in the ass).


It doesn’t actually require that second part. Every time I’ve used it in a production system, we had an approved list of query shapes that were accepted. If the client wanted to use a new kind of query, it was performance tested and sometimes needed to be optimized before approval for use.

If you open it up for any possible query, then give that to uncontrolled clients, it’s a recipe for disaster.


Oh, we have that too! But we call it HTTP endpoints.


GQL is an HTTP endpoint. The question is, how are you schematizing, documenting, validating, code-generating, monitoring, etc. the request and response on your HTTP endpoints? (OpenAPI is another good choice.)


Really? Hmm... where in the HTTP spec does it allow for returning an arbitrary subset of any specific request, rather than the whole thing? And where does it ensure all the results are keyed by id so that you can actually build and update a sensible cache around all of it rather than the mess that totally free-form HTTP responses lead to? Oh weird HTTP doesn't have any of that stuff? Maybe we should make a new spec, something which does allow for these patterns and behaviors? And it might be confusing if we use the exact same name as HTTP, since the usage patterns are different and it enables new abilities. If only we could think of such a name...


An HTTP Range request asks the server to send parts of a resource back to a client. Range requests are useful for various clients, including media players that support random access, data tools that require only part of a large file, and download managers that let users pause and resume a download.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Ran...


HTTP Range doesn't have anything to do with allowing a client to select a subset of fields.


The Range header isn't for requesting a subset of a resource from the server?


Let's say your REST endpoint returned an object with keys foo, bar, baz and quuz. How would you use HTTP Range to only select foo and baz?


also handy for bypassing bandwidth restrictions: capped at 100kbps? launch 1000 workers to grab chunks then assemble the survivors


that's what axel downloader does!


Etag and cache control headers?


Without wishing to take part in a pile on - I am wondering why you're using graphql if you are kneecapping it and restricting it to set queries.


Because it solves all sorts of other problems, like having a well-defined way to specify the schema of queries and results, and lots of tools built around that.

I would be surprised to see many (or any) GQL endpoints in systems with significant complexity and scale that allow completely arbitrary requests.


OpenAPI does the same thing for http requests, with tooling around it.

With typed languages you can auto-generate OpenAPI schemas from your code.


Yep, OpenAPI is also a good choice nowadays. That’s typically used with the assumption you’ve chosen a supported subset of queries. With GQL you have to add that on top.


Shopify's GraphQL API limits you in complexity (essentially max number of fields returned), but it's basically arbitrary shapes.


Probably for one of the reasons graphql was created in the first place - accomplish a set of fairly complex operations using one rather than a multitude of API calls. The set can be "everything" or it can be "this well-defined subset".


You could be right, but that's really just "Our API makes multiple calls to itself in the background"

I could be wrong but I thought GraphQL's point of difference from a blind proxy was that it was flexible.


It is flexible, but you don’t have to let it be infinitely flexible. There’s no practical use case for that. (Well, until LLMs, perhaps!)


I guess that I'm reading your initial post a little more strictly than you're meaning


I think they mean something like (or what I think of as) “RPC calls, but with the flexibility to select a granular subset of the result based on one or more schemas”. This is how I’ve used graphql in the past at least.


> I am wondering why you're using graphql if you are kneecapping it and restricting it to set queries.

Because you never want to expose unbounded unlimited dynamic queries in production. You do want a very small subset that you can monitor, debug, and optimize.


No.

It's a way to transmit a program from client to server. It then executes that program on the server side.


That sounds even worse!


It's not. The fragments you can execute are limited if you do it right. A client isn't allowed to just execute anything it wants, because the valid operations are pre-determined. The client sends a reference which executes a specific pre-planned fragment of code.

In development, you let clients roam free, so you have access to the API in a full manner. Deployments then lock-down the API. If you just let a client execute anything it wants in production, you get into performance-trouble very easily once a given client decides to be adventurous.

GraphQL is an execution semantics. It's very close to a lambda calculus, but I don't think that was by design. I think that came about by accident. A client is really sending a small fragment of code to the server, which the server then executes. The closest thing you have is probably SQL queries: the client sends a query to the server, which the server then executes.

It's fundamental to the idea of GraphQL as well. You want to put power into the hands of the client, because that's what allows a top-down approach to UX design. If you always have to manipulate the server-side whenever a client wants to change call structure, you've lost.


No one exposes SQL to clients though. I think where Gql differs from sql is it’s at a higher level. SQL bleeds performance and data layout (e.g. normalizing, limits), GraphQL does not.

It’s not clear if it’s high enough to abstract knowledge from storage. In the end it’s tension between enabling client to wander around productively vs being a bull in a china shop.


I wish people at least stopped using JavaScript and stopped writing requests to back-end by hand.


Pretty funny! I wonder how much of a premium Google is paying.


Unfortunately the problem isn't just "the internet sucks" it's "the internet sucks, and everyone uses it" - meaning people are not doing stuff offline, and a lot of our lives require us to be online.


The Internet is huming along beautifully

It is the Web that is being degraded


I don't think many look at wealth inequality in isolation, it's usually accompanied by how people are starving. E.g. "over 20 people die from malnutrition in the US but we have over 900 billionaire's" - e.g. each billionaire would probably only have to give $300k each (equiv to what the average tax payer gives to the defense budget each year) to prevent most deaths in the US due to lack of food - etc.


I get the feeling that you're winging the specific numbers because they're spectacularly incoherent.

But anyway, the United States is extremely rich and has essentially no big problems that can be solved by a small amount (say, a few billion) of money. The problems are either so big that it would take trillions to solve (supporting aging population etc), or blocked by something other than money (politics, regulations, etc). The big problems that can be solved just by throwing a few billion at them are solved quite easily by either the government or by private entities like the Gates Foundation.


In practice, it seems that politics generally takes precedence over problem solving. If you look into the psychology of it, neither politicians nor voters are really incentivized to solve big problems. This is especially true for big problems that will take more than an election cycle to solve.

It seems to me that it would be easy to support an argument that suggests more big problems could be solved if incentives were better aligned toward problem solving and if competent people, not professional politicians, were chosen to solve them.


One of the things you learn quickly when you look at these kind of problems is that they’re not so easy to solve with money. The budget for SNAP, the US’s primary food benefits program, is about $100 billion; the additional $270 million you propose would be a tiny drop in the bucket.


883 billion divided by 200 million is like 4 grand. How do you figure each taxpayer pays 300k/yr in taxes to the defense budget?


You make your currency the reserve currency, tax the world by inflating it while restricting circulation, print money, then borrow.

When people or countries potentially disrupt the equilibrium, kill them.


Sorry, I meant the math part


In the US, the poorest people suffer from an obesity epidemic. Virtually no one is starving in the US anymore, besides mental health problems or other edge cases creating it.


Volunteering at a food bank in any large city will change your perspective.

If you’re not where the rubber meets the road your knowledge of a system will always be incomplete and inaccurate. Literal trade secret of S Class developers, you’re welcome.


The poor are food insecure. This leads to obesity not because they have access to an abundance of food but because their access to food is not stead, leading to over eating to compensate, and the food they can afford is not healthy.


> the food they can afford is not healthy

Are you really claiming that it's cheaper to buy an appetite-satisfying amount of unhealthy food (chips/sweets/snacks/fast food) than fresh vegetables and staples like rice or potatoes?

Serious question.


Yes, both cheaper and more accessible and easier to eat without having to spend the time (which the working poor don't have) to then cook the raw foods. They're called food deserts.

https://en.wikipedia.org/wiki/Food_desert


Thanks for the link. I agree that preparation time is an important consideration. I do think that the food desert criterion (> 1.6km to the nearest supermarket in urban centres) seems very restrictive -- this would make half of most suburbs "food deserts" in the affluent western country where I live.

I find the more recent concept of "food swamps", also explained on that page, to be a (perhaps unwitting) direct challenge to the theory that absence of nearby healthy food is the root cause:

> A related concept is the phenomenon of a food swamp, a recently coined term by researchers who defined it as an area with a disproportionate number of fast food restaurants (and fast food advertising) in comparison to the number of supermarkets in that area.[13] The single supermarket in a low-income area does not, according to researchers Rose and colleagues, necessitate availability nor does it decrease obesity rates and health risks

If this claim is true -- that is, if areas with 1 nearby supermarket have obesity rates no better than areas with 0 -- then it's essentially impossible to blame health outcomes on the availability of healthy food nearby. If an area has nearby supermarkets, it is much harder to make the case that obesity is purely the result of external factors outside a person's control.


A fancy Nissin Cup of Noodle is $0.80 and 300 caloriesz. I just bought 2 lbs of hamburger meat for $15.

Food insecure people load up on cheap carbs. Most of them don’t know you to cook or lack gear and will buy a $5/16oz boil in bag rice vs. a 10lb bag for $6.


I started cutting my hair on the 7th of each month and things have been going really well for me. I won't stop now!


$50k would probably still be outrageous, like your car insurance doesn't have that generally.


what happens when you have two projects using different versions of node, etc? isn't that a massive headache?

not that it's great to start with, but it does happen, no?


You create a .node-version file and use fnm or nvm, and presto, when you cd into a project dir, the corresponding node version is activated.

Installing a particular node version also becomes as easy as

    fnm install 24


The rest of the world handles that through PATH/PATH equivalent.

Either the package manager is invoked with a different PATH (one that contains the desired Node/Java/whatever version as a higher priority item than any other version on the system).

Or the package manager itself has some way to figure that out through its config file.

Or there is a package manager launch tool, just like pyenv or whatever, which does that for you.

In practice it's not that a big of a deal, even for Maven, a tool created 21 years ago. As the average software dev you figure that stuff out a few weeks into using the tool, maybe you get burnt a few times early on for misconfiguring it and then you're on autopilot for the rest of your career.

Wait till you hear about Java's CLASSPATH and the idea of having a SINGLE, UNIFIED package dependency repo on your system, with no need for per-project dependency repos (node_modules), symlinks, or all of that stupidity.

CLASSPATH was introduced by Java in 1996, I think, and popularized for Java dependency management in 2004.


> The rest of the world handles that through PATH/PATH equivalent.

Activating a venv is just setting a few environment variables, including PATH, and storing the old values so that you can put them back to deactivate the environment.


It's also putting dependencies in a certain folder in a setup that isn't even portable between machines. Probably some other stuff I'm forgetting.


Well, that is how Python does it as well, an venv is a script setting the PYTHONPATH.


This is wrong. A venv is a hierarchy of folders containing a config file, as well as some symlinks to Python (or stub executables on Windows). "How Python does it" is that when it starts up from the symlink, it looks for the config file at a relative path; if that checks out, it uses hard-coded rules to add another relative path to sys.path. PYTHONPATH is never involved.

The venvs created by the standard library `venv`, as well as by uv (and by the third-party `virtualenv` that formed the original basis for `venv`), also happen to include "activation" scripts that manipulate some environment variables. PYTHONPATH is not among these. It manipulates PATH, so that the venv's symlink is on the path. And it may unset PYTHONHOME.


great book!

just took lessons recently with Matt from Lucky Dog Surf School. super chill dude, lots of fun.


""Sometimes it lets me down, but sometimes it really surprises me," he said."

Lol. This is the perfect capture of exec level AI understanding. Amazing.


TBH, this seems to encapsulate a very typical developer perspective on this site as well.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: