3 ms·
Yeah, it's gotta be a joke. The only one that actually sounds useful to me is HELP. I have to disagree with you on that one, a HELP that could explain the end
by freedomben 4y ago
Yeah, it's gotta be a joke. The only one that actually sounds useful to me is HELP.
I have to disagree with you on that one, a HELP that could explain the endpoint and verbs? that would be AWESOME. kind of like `kubectl explain`, which has been helpful to me on multiple occasions. Of course 99% of apps would not implement that, but frameworks could easily give you that for free as the dev, and reuse the declarative code that already exists in the router... There are already tools that generate swagger files and such, seems like it wouldn't be much harder to render a server response/document on demand. You could even serve a beautiful doc page viewable in a browser! The more I think on this, the more I like it.
- Joker_vD 4y agoThat's pretty much just entrypoint for HATEOAS, isn't it?
- hn_throwaway_99 4y agoFWIW, this is a huge benefit of GraphQL. All GraphQL servers that publish their schemas can instantly have their schemas loaded with full documentation and an interactive execution environment with GraphQL Playground.
- capableweb 4y agoIs it really a distinct benefit though since something similar to that have been existing for a really long time before GraphQL already? From OpenAPI/Swagger all the way back to HATEOS/HAL and RDF, if not even earlier.
- freedomben 4y agoI'm not generally a fan of graphql, but yes it's a remarkable feature. The other options (like swagger) take more effort and tend to not be maintained well. But even when they are, it's still not as developer friendly (to the client) as graphql.
- eurasiantiger 4y agoIt is a distinct benefit when your query playground is schema-aware and can suggest completions for types, fields and field (query) parameters, as well as validate everything pre-request.
- hn_throwaway_99 4y agoI've worked with all of those options before I started working with GraphQL. The "out-of-the-box" support, especially the standardization that GraphQL enforces with its schema definition, is/was night-and-day compared to something like Swagger.
- adeel_siddiqui 4y agoIsn't there already the OPTIONS verb which does the same thing as a possible HELP method? >The HTTP OPTIONS method requests permitted communication options for a given URL or server. A client can specify a URL with this method, or an asterisk (*) to refer to the entire server. https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OP...
- freedomben 4y agoYes, good point, OPTIONS would probably cover this use case. Anybody know of a framework (such as rails, phoenix, laravel, etc) that offers that? would be super interesting
- BerislavLopac 4y ago> The only one that actually sounds useful to me is HELP. And we already have OPTIONS for that.