graphql-patterns

graphql-patterns is a cursor rule for Cursor from Brahim-Benzarti/Shopify_store-MCP. It costs 0 tokens per session (1,042 once invoked), scanned A, original, ISC.

A collection of GraphQL rules and examples for Shopify's Admin and Storefront APIs. GraphQL is a way for an application to request exactly the data it needs from a service.

In plain words
What is it for?
Use it when reading or updating Shopify products, variants, inventory, orders, or other API data through GraphQL.
Why use it?
It reduces errors when querying Shopify data by standardizing query structure, pagination, product and order operations, and error handling.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when reading or updating Shopify products, variants, inventory, orders, or other API data through GraphQL.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/brahim-benzarti/shopify_store-mcp/graphql-patterns
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/Brahim-Benzarti/Shopify_store-MCP

Made for: Cursor.

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-patterns

README.md
[![agentmods](https://agentmods.dev/badge/rules/brahim-benzarti/shopify_store-mcp/graphql-patterns.svg)](https://agentmods.dev/rules/brahim-benzarti/shopify_store-mcp/graphql-patterns)
Your own site
<a href="https://agentmods.dev/rules/brahim-benzarti/shopify_store-mcp/graphql-patterns"><img src="https://agentmods.dev/badge/rules/brahim-benzarti/shopify_store-mcp/graphql-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,042 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.00000 $0.01042
Opus 5 $0.00000 $0.00521
Sonnet 5 $0.00000 $0.00208
Haiku 4.5 $0.00000 $0.00104

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

Security

Grade A, and why

graphql-patterns 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.

.cursor/rules/graphql-patterns.mdc · 252 lines

How it starts

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

GraphQL Patterns for Shopify APIs

Query Structure

Always use the #graphql tag for syntax highlighting:

export const QUERY_NAME = `#graphql
  query QueryName($var: Type!) {
    # ...
  }
`;

Pagination

Shopify uses cursor-based pagination:

query GetProducts($first: Int!, $after: String) {
  products(first: $first, after: $after) {
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {
      node {
        id
        title
      }
    }
  }
}

Common Admin API Patterns

Products

query GetProduct($id: ID!) {
  product(id: $id) {
    id
    title
    handle
    status
    variants(first: 10) {
      edges {
        node {
          id
          title
          price
          inventoryQuantity
        }
      }
    }
  }
}

mutation ProductUpdate($input: ProductInput!) {
  productUpdate(input: $input) {
    product {
      id
      title
    }
    userErrors {
      field
      message
    }
  }
}

Orders

query GetOrders($first: Int!, $query: String) {
  orders(first: $first, query: $query) {
    edges {
      node {
        id
        name
        totalPriceSet {
          shopMoney {
            amount
            currencyCode
          }
        }
        lineItems(first: 10) {
          edges {
            node {
              title
              quantity
            }
          }
        }
      }
    }
  }
}

Metafields

mutation MetafieldsSet($metafields: [MetafieldsSetInput!]!) {
  metafieldsSet(metafields: $metafields) {
    metafields {
      id
      namespace
      key
      value
    }
    userErrors {
      field
      message
    }
  }
}

Metaobjects

query MetaobjectByHandle($handle: MetaobjectHandleInput!) {
  metaobjectByHandle(handle: $handle) {
    id
    handle
    type
    fields {
      key
      value
    }
  }
}

mutation MetaobjectUpsert($handle: MetaobjectHandleInput!, $metaobject: MetaobjectUpsertInput!) {
  metaobjectUpsert(handle: $handle, metaobject: $metaobject) {
    metaobject {
      id
      handle
    }
    userErrors {
      field
      message
    }
  }
}

Read the full file on GitHub · 252 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 · 252 lines · 0 tokens per session scan A 8f5accb295e3

Subscribe to this mod's changes

graphql-patterns is a cursor rule published in the GitHub repository Brahim-Benzarti/Shopify_store-MCP (3 stars, last pushed 6mo ago), licensed ISC. It costs nothing until one of its globs matches a file; then it loads 1,042 tokens. 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.

Related

Other cursor rules, from other repositories

cursor

You are working on the checkout service. Preserve transaction integrity and auditability.

mrwogu/promptscript · 53 tokens

storage-plugin

Rules for creating storage-provider plug-ins in the Pixuli application. A storage provider is a component that can list, upload, delete, and create links for stored files.

trueLoving/Pixuli · 0 tokens

tray-api

Regras e documentação da API Tray. Aplica quando o desenvolvedor trabalhar com autenticação OAuth, produtos, pedidos, clientes, webhooks, frete, pagamentos ou qualquer outro recurso da plataforma Tray. Inclui convenções obrigatórias de autenticação, formato de payload, rate limit e índice completo de skills com…

tray-tecnologia/tray-api-ai-plugin · 70 tokens

headless-all

Composite skill for the headless track. Apply when designing or modifying a BFF (Backend-for-Frontend) layer, middleware, or API proxy for a headless VTEX storefront. Covers BFF middleware architecture, public vs private API classification, VtexIdclientAutCookie management, API key protection, and secure request…

vtex/skills · 26,100 tokens

marketplace-all

Composite skill for the marketplace track. Apply when building catalog or SKU synchronization logic for VTEX marketplace seller connectors. Covers the changenotification endpoint, SKU suggestion lifecycle, product data mapping, price and inventory sync, and fulfillment simulation. Use for implementing seller-side…

vtex/skills · 25,584 tokens

medusa

Medusa rules and best practices. These rules should be used when building applications with Medusa.

PatrickJS/awesome-cursorrules · 449 tokens