graphql

graphql is a command for coding agents from khadinakbarlabs/shopify-app-builder. It costs 19 tokens per session (645 once invoked), scanned A, original, MIT.

A command for building Shopify Admin GraphQL requests. GraphQL is a way to ask an API for specific data, while mutations change that data.

In plain words
What is it for?
Use it to read products, orders, customers, inventory, and fulfillments, or to update products, orders, inventory, and fulfillments.
Why use it?
It helps avoid outdated API versions, unnecessary data requests, high query costs, and poorly handled errors.

Command

Part of the shopify-app-builder plugin — 32 skills, 9 commands, 12 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/khadinakbarlabs/shopify-app-builder/graphql
Clone the repo
git clone --depth 1 https://github.com/khadinakbarlabs/shopify-app-builder

Or install shopify-app-builder, the plugin that ships this one along with the rest of its 32 skills, 9 commands, 12 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for graphql

README.md
[![agentmods](https://agentmods.dev/badge/commands/khadinakbarlabs/shopify-app-builder/graphql.svg)](https://agentmods.dev/commands/khadinakbarlabs/shopify-app-builder/graphql)
Your own site
<a href="https://agentmods.dev/commands/khadinakbarlabs/shopify-app-builder/graphql"><img src="https://agentmods.dev/badge/commands/khadinakbarlabs/shopify-app-builder/graphql.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 645 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00019 $0.00645
Opus 5 $0.00010 $0.00322
Sonnet 5 $0.00004 $0.00129
Haiku 4.5 $0.00002 $0.00064

Measured 5d ago against content hash 5fc9d8115d88, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

graphql scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/graphql.md · 65 lines

How it starts

The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Admin GraphQL Operations

You are constructing Admin GraphQL queries and mutations with cost optimization. Confirm the latest stable API version before generating the endpoint.

Query Planning

  1. Select operation type and resources

    • Query operations: products, orders, customers, inventory, fulfillments
    • Mutation operations: updateProduct, createOrder, updateInventory, addFulfillment
    • Confirm the latest stable API version and the store plan's cost restore rate (standard: 100 points/second)
    • Reference skill: GraphQL operations (02_apis.md)
  2. Design query structure

    • Request only necessary fields (don't use fragments initially for clarity)
    • Use pagination with first:25, after: "[cursor]" for large result sets
    • Add filters for specific resource lookups (e.g., query: "status:active")
    • Minimize nested relationships to reduce query cost
    • Reference skill: query optimization (02_apis.md)
  3. Calculate query cost

    • Use query complexity algorithm: each field has cost value
    • Simple fields (id, title) = 1 point; connections (products) = depends on requested count
    • Example: products(first:25) with 5 fields per product ≈ 75 points
    • Keep queries under 800 points for safety margin
    • Reference skill: cost calculation (02_apis.md)

Implementation

  1. Build GraphQL request

    • Use GraphQL client library (Apollo Client or @shopify/graphql-request)
    • Construct operation string with query/mutation definition
    • Add variables object for dynamic parameters (e.g., productId, input data)
    • Include error handling for rate limit responses (HTTP 429)
  2. Execute and handle responses

    • Send POST request to https://[store-domain]/admin/api/2026-07/graphql.json, after confirming 2026-07 is still supported
    • Include X-Shopify-Access-Token header with session token
    • Parse response.data for successful operations
    • Log response.extensions.cost for monitoring (track cumulative daily cost)
    • Reference skill: API versioning (02_apis.md)

Read the full file on GitHub · 65 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 65 lines · 19 tokens per session scan A 5fc9d8115d88

Subscribe to this mod's changes

graphql is a command published in the GitHub repository khadinakbarlabs/shopify-app-builder (1 stars, last pushed 26d ago), licensed MIT. It adds 19 tokens to every session and 645 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.