apollographql / apollo-tooling

✏️ Apollo CLI for client tooling (Mostly replaced by Rover)
https://apollographql.com
MIT License
3.04k stars 468 forks source link

Command to execute query from Apollo CLI #1700

Open JakeDawkins opened 4 years ago

JakeDawkins commented 4 years ago

It'd be helpful to have a command in the CLI to execute operations against a graphql server. The output could be piped to other tools

For example:

apollo execute "query(id: ID!) { node(id: $ID) { ... on User { username } } }" --variables=\{ "id": 1 \} --headers=authorization:"bearer 12345" | jq 'data.node.username' | cat

The logic and maintenance of this command would be pretty minimal if my thinking is correct.

zionts commented 4 years ago

I'm curious what this functionality offers beyond curl