4 ms·
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
by wrs 11mo ago
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.
- kaoD 11mo agoOh, we have that too! But we call it HTTP endpoints.
- johnfn 11mo agoReally? 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...
- eli 11mo agoAn 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/Range_requests https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Ran...
- 867-5309 11mo agoalso handy for bypassing bandwidth restrictions: capped at 100kbps? launch 1000 workers to grab chunks then assemble the survivors
- fragmede 11mo agothat's what axel downloader does!
- johnfn 11mo agoHTTP Range doesn't have anything to do with allowing a client to select a subset of fields.
- tlarkworthy 11mo agoEtag and cache control headers?
- wrs 11mo agoGQL 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.)
- deleted 11mo ago[deleted]
- awesome_dude 11mo agoWithout 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.
- kspacewalk2 11mo agoProbably 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".
- awesome_dude 11mo agoYou 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.
- wrs 11mo agoIt 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!)
- awesome_dude 11mo agoI guess that I'm reading your initial post a little more strictly than you're meaning
- mcpeepants 11mo agoI 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.
- wrs 11mo ago