migrate-rest-to-graphql

migrate-rest-to-graphql is a command for Claude Code from khadinakbarlabs/shopify-app-builder. It costs 22 tokens per session (778 once invoked), scanned A, original, MIT.

A migration workflow for replacing older Shopify REST Admin API calls with the newer GraphQL Admin API. REST and GraphQL are two ways for an app to request data from Shopify.

In plain words
What is it for?
Use it to inventory REST endpoints, map response fields, compare request costs, prioritize migrations, and convert related reads or updates.
Why use it?
It helps developers find old API calls, match them to GraphQL operations, and plan changes around request cost and usage.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

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

Good fit Use it to inventory REST endpoints, map response fields, compare request costs, prioritize migrations, and convert related reads or updates.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/khadinakbarlabs/shopify-app-builder/migrate-rest-to-graphql
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 migrate-rest-to-graphql

README.md
[![agentmods](https://agentmods.dev/badge/commands/khadinakbarlabs/shopify-app-builder/migrate-rest-to-graphql/github.svg)](https://agentmods.dev/commands/khadinakbarlabs/shopify-app-builder/migrate-rest-to-graphql)
Your own site
<a href="https://agentmods.dev/commands/khadinakbarlabs/shopify-app-builder/migrate-rest-to-graphql"><img src="https://agentmods.dev/badge/commands/khadinakbarlabs/shopify-app-builder/migrate-rest-to-graphql/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 migrate-rest-to-graphql

Your own site · 80×15
<a href="https://agentmods.dev/commands/khadinakbarlabs/shopify-app-builder/migrate-rest-to-graphql"><img src="https://agentmods.dev/badge/commands/khadinakbarlabs/shopify-app-builder/migrate-rest-to-graphql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 778 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.00022 $0.00778
Opus 5 $0.00011 $0.00389
Sonnet 5 $0.00004 $0.00156
Haiku 4.5 $0.00002 $0.00078

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

Security

Grade A, and why

migrate-rest-to-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 10d 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/migrate-rest-to-graphql.md · 77 lines

How it starts

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

Migrate REST to GraphQL

You are converting Shopify REST API calls to GraphQL for improved performance, better cost efficiency, and future API compatibility.

Migration Assessment

  1. Inventory REST endpoints

    • Search codebase for /admin/api/[year]/[resource].json endpoints
    • Document each REST call: method (GET/POST/PUT), resource type, usage frequency
    • Identify which endpoints have GraphQL query equivalents
    • Map REST response fields to GraphQL query fields (field names may differ)
    • Reference skill: API versioning and migration (02_apis.md)
  2. Assess cost-benefit

    • Calculate REST endpoint cost (count-based billing, higher for batch operations)
    • Estimate GraphQL query cost for equivalent operation (field-level granularity)
    • Example: REST GET /products.json (100 fields) = 10 API calls/s; GraphQL query (10 fields) = 75 points
    • Identify high-impact migrations (batch endpoints, pagination-heavy queries)
    • Reference skill: GraphQL cost optimization (02_apis.md)
  3. Plan migration priority

    • Prioritize REST endpoints with highest call volume
    • Start with read operations (GET) before mutations
    • Group related endpoints for batch migration (product endpoints together)
    • Plan rollback strategy for each migration phase
    • Reference skill: migration planning (02_apis.md)

Implementation

  1. Convert REST to GraphQL queries

    • Rewrite the REST products request as a GraphQL query using the latest supported stable API version
    • Add pagination with first: 25, after: "[cursor]" to REST limit parameters
    • Map REST filters (status=active) to GraphQL query filters
    • Include only needed fields (don't request full object if only id, title needed)
    • Reference skill: GraphQL query construction (02_apis.md)
  2. Implement GraphQL client

    • Replace REST fetch calls with GraphQL client (@shopify/graphql-request or Apollo)
    • Update authentication header: X-Shopify-Access-Token (same as REST)
    • Convert response parsing: REST array becomes GraphQL data.resources.edges
    • Implement error handling for GraphQL errors (different structure than REST)
    • Reference skill: GraphQL client implementation (02_apis.md)

Read the full file on GitHub · 77 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. 10d ago First seen · 77 lines · 22 tokens per session scan A c15f379d43bd

Subscribe to this mod's changes

migrate-rest-to-graphql is a command published in the GitHub repository khadinakbarlabs/shopify-app-builder (1 stars, last pushed 1mo ago), licensed MIT. It adds 22 tokens to every session and 778 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.