[HN Gopher] Graphqurl: Curl for GraphQL, with Autocomplete and S...
       ___________________________________________________________________
        
       Graphqurl: Curl for GraphQL, with Autocomplete and Subscriptions
        
       Author : jaredwiener
       Score  : 107 points
       Date   : 2021-01-05 15:16 UTC (7 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | drewda wrote:
       | 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.
        
         | latte wrote:
         | > 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
        
       | backing wrote:
       | Why javascript though?
        
       | asiando wrote:
       | 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.
        
         | tuukkah wrote:
         | To clarify, GraphiQL and GraphQL Playground are already
         | available as Electron apps, but they lack the CLI option.
        
       | Namari wrote:
       | 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
        
         | gavinray wrote:
         | 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
        
         | 1vuio0pswjnm7 wrote:
         | Are there any more extensive examples of what users would want
         | the output to look like from "curl for GraphQL". What is the
         | "ideal" output format users expect.
        
         | alpaca128 wrote:
         | 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.
        
       ___________________________________________________________________
       (page generated 2021-01-05 23:01 UTC)