AGENT SKILL

graphql-cli

Query GraphQL endpoints using curl or graphql-cli. Use when the user mentions GraphQL, graphql query, graphql mutation, or graphql schema.

License 许可
MIT
最近更新
2026-11-02
Stars
★ 0
Forks
0

01 前言 Front Matter

name
graphql-cli
description
Query GraphQL endpoints using curl or graphql-cli. Use when the user mentions GraphQL, graphql query, graphql mutation, or graphql schema.

03 SKILL.md 正文

GraphQL CLI

Query GraphQL endpoints directly via curl or npx graphqurl through the Bash tool. Replaces the GraphQL MCP server with native CLI calls.

Prerequisites

No installation required -- curl is available on all systems. For a friendlier interface:

# Check if graphqurl is available
npx graphqurl --version 2>/dev/null || echo "graphqurl not cached; will be fetched on first use via npx"

Default endpoint

If the GRAPHQL_ENDPOINT environment variable is set, use it. Otherwise default to http://localhost:4000/graphql:

ENDPOINT="${GRAPHQL_ENDPOINT:-http://localhost:4000/graphql}"

Queries with curl

Basic query

curl -s -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ users { id name email } }"}'

Query with variables

curl -s -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query GetUser($id: ID!) { user(id: $id) { id name email } }",
    "variables": {"id": "123"}
  }'

Query with authentication

curl -s -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"query":"{ me { id name } }"}'

Pretty-print response

Pipe through jq for readable output (if available) or python -m json.tool:

curl -s -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ users { id name } }"}' | jq .

Mutations with curl

Basic mutation

curl -s -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "mutation CreateUser($input: CreateUserInput!) { createUser(input: $input) { id name } }",
    "variables": {"input": {"name": "Alice", "email": "alice@example.com"}}
  }'

Schema Introspection

Full introspection query

curl -s -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ __schema { types { name kind description } } }"}' | jq .

List all types

curl -s -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ __schema { types { name kind } } }"}' | jq '.data.__schema.types[] | select(.kind != "SCALAR" and (.name | startswith("__") | not))'

Inspect a specific type

curl -s -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ __type(name: \"User\") { name fields { name type { name kind ofType { name } } } } }"}' | jq .

List all queries and mutations

# Queries
curl -s -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ __schema { queryType { fields { name description args { name type { name } } } } } }"}' | jq .

# Mutations
curl -s -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ __schema { mutationType { fields { name description args { name type { name } } } } } }"}' | jq .

Using graphqurl (Alternative)

graphqurl provides a more ergonomic interface via npx:

Basic query

npx graphqurl "$ENDPOINT" -q '{ users { id name email } }'

Query with variables

npx graphqurl "$ENDPOINT" \
  -q 'query GetUser($id: ID!) { user(id: $id) { id name email } }' \
  -v 'id=123'

Query with headers

npx graphqurl "$ENDPOINT" \
  -H "Authorization: Bearer $TOKEN" \
  -q '{ me { id name } }'

Introspection

npx graphqurl "$ENDPOINT" --introspect

Tips

  • Always use -s (silent) with curl to suppress progress output.
  • Pipe responses through jq . for readable formatting.
  • For large queries, write the query to a file and use curl -d @query.json.
  • Use jq selectors to extract specific fields: | jq '.data.users[].name'.
  • When debugging, add -v to curl to see request/response headers.

Error Handling

"Connection refused"

  • The GraphQL server may not be running. Check that the endpoint is correct and the server is up.
  • Verify with: curl -s -o /dev/null -w "%{http_code}" "$ENDPOINT"

"400 Bad Request" or "Syntax Error"

  • Check the query syntax. GraphQL queries must be valid.
  • Ensure JSON is properly escaped in the -d payload.

"401 Unauthorized" or "403 Forbidden"

  • Include the correct authentication header.
  • Verify the token is valid and has the required scopes.

"Cannot query field" errors

  • Run an introspection query to check available fields on the type.
  • The schema may have changed -- re-inspect with __schema.

04 同仓库更多 Skills

Prekzursil
Prekzursil/agent-skills-toolchain

clarify-requirements

Resolve genuine pre-execution ambiguity by scanning repo context, generating 1-6 grounded options, and asking 1-3 focused questions via AskUserQuestion. NOT for mid-task use (injection risk); NOT when the goal is already unambiguous; use to disambiguate vague prompts before any file edits.

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

openmm-md

Run FREE, open-source, Windows-native GPU molecular dynamics via the openmm-md MCP (OpenMM + CUDA on the local NVIDIA GPU). Use for protein / protein-ligand MD when you want a free stack or are on Windows without a Schrodinger license. Covers the full workflow (prepare, solvate, minimize, equilibrate, production, analyze, mmgbsa) AND an honest decision guide vs Schrodinger Desmond, including how to run Desmond legitimately on Linux or a cloud GPU with a real license. This is a deliberately LESSER free alternative and does NOT replace the schrodinger MCP tools. Do NOT use it to pick a free tool when a validated FEP+, WaterMap, IFD-MD, or Prime MM-GBSA result is actually required.

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

visual-review

Take screenshots of web pages and UI using Playwright for visual review and iteration

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

status

Diagnostic status report — shows metaswarm installation state, project setup, and potential issues

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

start

Use when starting work on any task, when the user mentions metaswarm, or when the user wants to begin tracked development work

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

setup

Interactive project setup — detects your project, configures metaswarm, writes project-local files

★ 0