graphqurl
$ gq Official Low Riskgraphqurl (hasura/graphqurl, binary gq) executes GraphQL queries, mutations, and WebSocket subscriptions from the command line (gq <url> -q '...'), supports custom headers (-H) and variables (-v), and exports remote GraphQL schemas via --introspect in SDL or --format json.
npm install -g graphqurl gq inspects remote GraphQL schemas with --introspect and runs targeted queries returning pure JSON without wrapping a GraphQL endpoint inside an MCP server.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Native JSON GraphQL responses, --introspect --format json, and headless -q/-v/-H execution, though bare gq <url> enters interactive mode.
- Emits JSON responses natively and supports
--introspect --format json - Headless when
-qor--introspectis provided
Stateless invocation with explicit headers, though GraphQL mutations require caller inspection (no --dry-run).
- No persisted credentials; scoped
-Hheaders per command
Cross-platform npm package (graphqurl / npx graphqurl) requiring Node.js.
- Available via
npm install -g graphqurlornpx graphqurl
Far cleaner than hand-escaping GraphQL JSON bodies in curl, with built-in schema introspection and subscriptions.
- Supports queries, variables (
-v), GraphiQL (--graphiql), and--introspect
Official Hasura repository (hasura/graphqurl) under Apache-2.0, feature-complete with slow release cadence.
- Hasura-maintained
hasura/graphqurlunder Apache-2.0
Clear README examples for queries, subscriptions, and introspection.
- Structured README examples and
--helpreference
Security, Auth & Guardrails
Stateless; accepts auth tokens or Hasura admin secrets via -H "Authorization: ..." or -H "x-hasura-admin-secret: ...".
Apache-2.0 open-source Node.js CLI; completely free.
# graphqurl (gq) Agent Rules - Always pass `-q '...'` or `--introspect` so `gq` runs one-shot and does not enter interactive prompt mode. - Run `gq <url> --introspect` first to verify exact field names before writing queries or mutations. - Check whether `-q` contains a `mutation` before executing against production endpoints.
Agent-Ready Command Recipes
Safe Read-Only Queries
gq https://api.example.com/graphql --introspect --format json
Fetches the GraphQL introspection schema and emits it in JSON format.
gq https://api.example.com/graphql -q 'query($id: ID!) { user(id: $id) { id name } }' -v id=42 Sends a read-only GraphQL query with typed variables and prints the JSON response.
Controlled Writes & Previews
gq https://api.example.com/graphql -H "Authorization: Bearer $API_TOKEN" -q 'mutation { ... }' Sends an authenticated GraphQL mutation and outputs the server JSON response.
Strengths for Agents
- +
gq <url> --introspectlets agents discover GraphQL schemas in SDL or JSON immediately. - + Ergonomic
-qand-vflags avoid brittle JSON escaping compared tocurl.
Caveats & Pitfalls
- ! Running
gq <url>without-qor--introspectenters an interactive auto-complete prompt. - ! Older Node.js codebase with infrequent upstream updates.