Hacker News new | past | comments | ask | show | jobs | submit login
Graphqurl: Curl for GraphQL, with Autocomplete and Subscriptions (github.com/hasura)
127 points by jaredwiener on Jan 5, 2021 | hide | past | favorite | 8 comments



We've found much to like about GraphQL, but it's a minor annoyance that most GraphQL-based web services only accept POST requests (not also GET requests) and treat white-space in the query as meaningful. These little factors make it harder to run ad-hoc queries by curl/httpie/etc or in a web browser.

Will have to give this tool a try to see how well it fits for quick, little debugging of GraphQL endpoints.


> most GraphQL-based web services only accept POST requests (not also GET requests)

A GraphQL server should generally be able to accept GET queries according to the spec [1]. Are there any common implementations that don't follow this?

[1] https://graphql.org/learn/serving-over-http/#get-request


Nice work, I guess it could be useful, though I would only use CLI if there is no other way, it's not easy to read compared to the one on Playground/GraphiQL


Part of the point is that it can launch a GraphiQL playground instance (which is how I use it most of the time)

You have the URL to some GQL API you need to look at, and so you run "gq" on the shell and pass the URL + flags for it to start a webserver running GraphiQL and auto-open it in your browser


At least on my setup the Playground UI likes to break under some circumstances and is rather slow. The CLI output can be easy to read once you view it with syntax highlighting, and it's trivial to pipe the output for any further processing.

This is a great project and I'll definitely check it out the next time.


Offering the UI in the browser versus just the CLI is an interesting idea. Go one step further and just display the results in the browser. Go another step and you got an Electron app, no CLI at all.


To clarify, GraphiQL and GraphQL Playground are already available as Electron apps, but they lack the CLI option.


Why javascript though?




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

Search: