← Back to Blog

How to Run an AI GraphQL Agent with OE Runtime

Query any GraphQL API with natural language. OE Runtime introspects your schema, constructs type-safe queries with variables, executes them against your API, and returns structured results — no GraphQL expertise required.

🔷
Step 1
Introspect Schema
Call the GraphQL introspection query to understand available types, queries, and mutations.
Step 2
Execute Operation
Run a sample query using variables for dynamic values and return the raw result.
Step 3
Report
Summarise the operation executed, fields fetched, record count, and key values from the first results.

What You Need


Create the Project Folder

Create a folder called graphql/ and add these two files:

graphql/
├── SKILL.md         # the portable skill (agentskills.io)
├── agent.yaml       # wires SKILL.md to your connector
└── oe-config.json  # LLM key + connector credentials

The Skill Files

Create SKILL.md inside a graphql/ directory. This is the portable skill — it follows the agentskills.io format and runs unchanged on Claude, Cursor, Windsurf, or OE Runtime:

---
name: graphql
description: Run GraphQL queries and mutations
license: Apache-2.0
metadata:
  author: Open Enthrium
  version: "1.0"
---

You are a GraphQL API agent. Run queries to fetch data and mutations to create or update records.
Always use variables for dynamic values — never interpolate directly into queries.
Complete all steps fully before writing your report.

## Step 1: Introspect Schema
Call the GraphQL introspection query to understand the available types, queries, and mutations.
List the key types and operations available.

## Step 2: Execute Operation
Based on the schema, run a sample query to fetch a list of records from the most relevant type.
Use variables for any dynamic values. Return the raw result.

## Step 3: Report
Summarize what was returned:
- Operation executed (query or mutation)
- Fields fetched
- Number of records returned
- Key values from the first 3 records

Create agent.yaml in the same directory to wire the skill to your connector:

name: GraphQL Agent
description: Run GraphQL queries and mutations
connectors:
  - connection_name: My GraphQL API
    connection_type: graphql
skills:
  - path: ./
    trigger_type: auto

The Config File

Create oe-config.json in the same directory:

{
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "apiKey": "YOUR_OPENAI_API_KEY"
  },
  "server": {
    "enabled": false,
    "port": 3333,
    "apiKey": "your-secret-api-key"
  },
  "connectors": [
    {
      "connection_name": "My GraphQL API",
      "connection_type": "graphql",
      "endpoint": "https://api.example.com/graphql",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  ]
}

Replace the endpoint with your GraphQL API URL and set the Authorization header with your API token. The agent works with any GraphQL API including GitHub, Shopify, Hasura, and custom APIs.

Download OE Runtime

OE Runtime — Direct Downloads

Run the Agent

From the parent folder containing your skill directory:

MethodBest forDownload
1 npx recommended No install needed — always runs the latest version —
2 Windows .exe Download once, run offline on Windows ⊞ Windows (.exe)
3 macOS binary Download once, run offline on Mac  macOS
4 Linux binary Server deployments, cron jobs, Docker 🐧 Linux
5 API Server integration Call from any app, webhook, or automation pipeline 📮 Postman Collection

1 npx recommended

npx -y @openenthrium/oe-runtime@latest ./graphql

2 Windows

oe-runtime-win.exe ./graphql

3 macOS

chmod +x oe-runtime-macos
./oe-runtime-macos ./graphql

First run blocked? System Settings → Privacy & Security → Allow Anyway.

4 Linux

chmod +x oe-runtime-linux
./oe-runtime-linux ./graphql

5 API Server integration

Add a "server" block to oe-config.json, then start with --serve:

{
  "llm": { ... },
  "server": { "enabled": true, "port": 3333, "apiKey": "your-secret-key" },
  "connectors": [ ... ]
}
npx -y @openenthrium/oe-runtime@latest --serve --config oe-config.json

Run with inline YAML:

curl -X POST http://localhost:3333/run \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret-key" \
  -d '{"yaml": "...", "params": {}}'

Or run from a file on the server:

curl -X POST http://localhost:3333/run-file \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret-key" \
  -d '{"file": "/path/to/agent.yaml", "params": {}}'

Use Cases

Build your own agents with OE Runtime

Download OE Runtime and run any AI agent locally or as a server — no cloud required.

Get OE Runtime →
Series OE Runtime Agent Guides — 21 Connectors
Series overview →