Validate GraphQL Codeblocks
Validate Shopify GraphQL against the bundled schema — offline, before any store call
validate_graphql_codeblocks
Validates one or more Shopify GraphQL code blocks against Shopify's bundled schemas through the embedded Shopify dev MCP server. It runs entirely offline — no network, no store call — and flags hallucinated or invalid fields locally, so your AI client can fix an operation before spending any Shopify API budget.
Read-only. This is the safety check to run before shopify_admin_graphql; in fact, the execute tool runs this same bundled-schema validation on every operation for you. Call learn_shopify_api first and pass its conversationId.
Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
codeblocks | object[] | Yes | The GraphQL code blocks to validate. Each is { content, artifactId?, revision? } — see below. | — |
api | string | No | Which GraphQL API to validate against. Enum: admin, storefront-graphql, customer, functions_*, and more. | admin |
version | string | No | Shopify API version to validate against, YYYY-MM (e.g. 2026-04). Omit to use the current stable version. | — |
conversationId | string | No | Conversation id returned by learn_shopify_api. Omit and one is minted for you. | — |
Each entry in codeblocks is an object:
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Raw GraphQL source, without markdown code fences. |
artifactId | string | No | Stable artifact id when validating a revision of an operation. |
revision | number | No | Artifact revision number (non-negative integer). |
Returns
- A validation result per code block — valid, or the specific fields/types that failed against the bundled schema.
Example prompts
Validate this Admin GraphQL query against the bundled schema before we run itCheck whether this mutation uses real Admin API fields for version 2026-04Notes
apidefaults toadmin— the API CDP brands work with. The other enum values target storefront, customer, and Shopify Functions schemas.- Validation is offline and free: it uses schemas bundled with the server, so it catches hallucinated field names without touching your store or Shopify's API.
shopify_admin_graphqlalready pre-validates every operation this way before executing — running this tool yourself is a way to iterate on a draft first.