hasura / graphqurl

curl for GraphQL with autocomplete, subscriptions and GraphiQL. Also a dead-simple universal javascript GraphQL client.
Apache License 2.0
3.34k stars 101 forks source link

[FEATURE REQUEST] allow basic REPL like scripting #118

Open marcosnils opened 2 years ago

marcosnils commented 2 years ago

Hey there, congrats for gq, it's really an awesome tool.

Today thinking about the possibilities of gq, I was dreaming with the idea of allowing some sort of basic scripting. A very basic example of what I'd like to do in gq would be something like this:

gql> let repo = query {
  repositories(ref: "foo/foo")
} <CR>

mutation {
  createIssue(ref: "$repo.ref") {
   url
  }
} <CR>

# get the URL of the repo from the mutation response.

The idea would be that without too much complexity, have the ability of wiring some javascript code to prototype a simple flow of calling multiple graphql queries and mutations.

thoughts?