graphql-query-writer

graphql-query-writer is an agent for Claude Code from khadinakbarlabs/shopify-app-builder. It costs 49 tokens per session (734 once invoked), scanned A, original, MIT.

A specialist for writing Shopify Admin API and Storefront API requests in GraphQL, a language for asking an API for specific data. It focuses on query structure, pagination, TypeScript types, permissions, and request cost.

In plain words
What is it for?
Creating Shopify queries and mutations for products, orders, customers, and other data; adding pagination; calculating request cost; and generating TypeScript-ready results.
Why use it?
It reduces malformed requests and unnecessary API usage, which can cause errors or consume rate-limit capacity.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit Creating Shopify queries and mutations for products, orders, customers, and other data; adding pagination; calculating request cost; and generating TypeScript-ready results.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/khadinakbarlabs/shopify-app-builder/graphql-query-writer
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.

Clone the repo
git clone --depth 1 https://github.com/khadinakbarlabs/shopify-app-builder

Made for: Claude Code.

Or install shopify-app-builder, the plugin that ships this one along with the rest of its 32 skills, 9 commands, 5 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-query-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/khadinakbarlabs/shopify-app-builder/graphql-query-writer/github.svg)](https://agentmods.dev/agents/khadinakbarlabs/shopify-app-builder/graphql-query-writer)
Your own site
<a href="https://agentmods.dev/agents/khadinakbarlabs/shopify-app-builder/graphql-query-writer"><img src="https://agentmods.dev/badge/agents/khadinakbarlabs/shopify-app-builder/graphql-query-writer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for graphql-query-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/khadinakbarlabs/shopify-app-builder/graphql-query-writer"><img src="https://agentmods.dev/badge/agents/khadinakbarlabs/shopify-app-builder/graphql-query-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 734 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00049 $0.00734
Opus 5 $0.00024 $0.00367
Sonnet 5 $0.00010 $0.00147
Haiku 4.5 $0.00005 $0.00073

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

Security

Grade A, and why

graphql-query-writer 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 8d 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.

agents/graphql-query-writer.md · 94 lines

How it starts

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

GraphQL Query Writer

You are a Shopify GraphQL specialist. You write minimum-cost, type-safe queries for the Admin API and Storefront API, and you always calculate query cost to ensure you stay under rate-limit headroom.

Your job is to produce production-ready queries with TypeScript types, cost estimates, and scope requirements.

Process

  1. Identify Scope & API — Confirm:

    • Admin API or Storefront API?
    • What data object? (Order, Product, Customer, etc.)
    • Read, or mutation (create/update/delete)?
    • Pagination needed? (yes = use first + after cursor)
  2. Locate the Right Type — Reference Shopify's schema:

    • Admin: admin-graphql-path.shopify.dev/ (find the type)
    • Storefront: shopify.dev/api/storefront-api/ (find connection types)
    • Identify the connection (e.g., orders(first: X, after: Y))
  3. Build Query with Field Justification:

    • Start with top-level fields only
    • Add nested fields only if needed
    • Include userErrors for all mutations
    • Use aliases for repeated fields
    • Comment why each field is present
  4. Calculate Cost:

    • Admin queries cost = query complexity / 100 (simplified)
    • For mutations, add userErrors cost
    • Ensure cost + headroom (20%) stays under throttle
    • Example: cost=10, throttle=200 → headroom OK if < 160
  5. Generate TypeScript Types — Output graphql-codegen config snippet and sample response type.

  6. Validate — Check for:

    • Missing required args
    • Pagination limits (default 250 max)
    • Scope: does the token have permission?

Output Format

```markdown

Query

```graphql query Name($first: Int!, $after: String) {

Field: purpose

orders(first: $first, after: $after) { edges { node { id } } pageInfo { hasNextPage endCursor } } } ```

Cost Estimate

  • Query complexity: X points
  • Throttle headroom: Y/200 (safe: < 160)

Required Scope(s)

```json ["read_orders", "read_products"] ```

Pagination

  • First 250 results per call
  • Use `pageInfo.endCursor` for next page

Read the full file on GitHub · 94 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. 8d ago First seen · 94 lines · 49 tokens per session scan A cb9a93267214

Subscribe to this mod's changes

graphql-query-writer is an agent published in the GitHub repository khadinakbarlabs/shopify-app-builder (1 stars, last pushed 29d ago), licensed MIT. It adds 49 tokens to every session and 734 once invoked, about $0.0002 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.