/sitecore-platform:sitecoreai-edge-graphql-capturefrom Sitecore Platform (SitecoreAI)
Provides curl recipes for Sitecore Experience Edge GraphQL: endpoint setup, introspection depth limits, complexity vs pagination tradeoffs, ComponentQuery budget, and site/route/layout queries. Useful for capturing snapshots, probing live data without the SDK, or debugging Edge errors.
Ships in Sitecore Platform (SitecoreAI). Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
How to talk directly to Sitecore Experience Edge with curl and produce an edge-snapshot/ folder (introspection + per-pattern layout JSON) for a playground or a product. No SDK, no CLI, no auth header — just POST + GraphQL.
edge-snapshot/ of a new playground (per content-sdk-playground-pattern).POST https://edge-platform.sitecorecloud.io/v1/content/api/graphql/v1?sitecoreContextId=<CONTEXT_ID>
Content-Type: application/json
Authorization header. The sitecoreContextId in the query string IS the access control. Treat it like a public-ish API key — anyone with it can read your Edge data, but they can't write.https://edge-platform.sitecorecloud.io — service endpoints incl. GraphQL (this skill).https://edge.sitecorecloud.io — media URL replacement only (legacy / asset CDN)./schema URL that returns SDL — you must POST a query.The standard GraphQL "full IntrospectionQuery" (the one every GraphiQL ships with) is 26 levels deep. It will fail with:
{"errors":[{"message":"Query is too nested to execute. Depth is 26 levels, maximum allowed on this endpoint is 15.","extensions":{"code":"INVALID_OPERATION"}}]}
Workaround: use per-type introspection (see § Workaround below). Do NOT try to fetch the whole schema in one shot.
A wide pagination (first: 100) with a moderately nested selection will be rejected as too complex:
{"errors":[{"message":"Query is too complex to execute. The field with the highest complexity is: ...","extensions":{"code":"INVALID_OPERATION"}}]}
Empirical rule of thumb (verified on the training tenant 2026-05-27):
routes(first: 4, …) with selection { routePath route { id name } } → too complexroutes(first: 100, …) with selection { routePath } → too complexroutes(first: 10, …) with selection { routePath } → worksSo: shrink page size first, then shrink selection set. Paginate with after cursor across multiple requests rather than fetching everything in one call.
A literal first: costs more than a variable (preview, measured 2026-10-02): siteInfo.dictionary(first: 61){ results{ key value } } is too complex, while first: $f with f = 1000 resolves. Pass page sizes as variables, as the SDK does. first: 1001 is a warning plus clamp on live and a hard error on preview. The language argument is case-insensitive.
Measured on a real preview endpoint, 2026-08-11 (a 7-item children connection —
so this is the SELECTION cost, not a data-volume effect):
| Query | Result |
|---|---|
children(first:20) each with a nested units(first:30) connection + one field | refused |
children(first:50) selecting name displayName + two field(...) | refused |
children(first:50) selecting two field(...) only | ok |
children(first:30) selecting name + two field(...) | ok |
children(first:50) selecting id name (no field(...)) | ok |
Two things that table shows and prose does not:
field(name:"X"){ value } selections are expensive — far more than plain name/id.
Dropping one redundant scalar (displayName) was enough to bring a refused query back
under budget at the same page size.first: rescued a "developments each with their units" aggregate. Fetch the parents
in one flat query and the children per-parent (deliberate N+1), deduplicated with
React.cache() so components on one page share the fan-out.⚠️ THE FAILURE IS LOUD AT THE ENDPOINT AND SILENT IN THE UI. Every sensible consumer catches the rejection and degrades — so an over-budget query shows up as an empty select, a missing count, or a section that vanished, none of which look like a query error. One instance shipped this way and was found by reading the rendered page, not by a test. Probe the budget with a single POST whenever a query grows a field or raises
first:.
ComponentQuery budget (measured 2026-09-26 → 28, preview Edge)A ComponentQuery runs through the same limits, and one build hit them on six of about twenty
renderings. The numbers below are one tenant's ceilings. They tell you what to probe first; they never
replace the probe:
| Shape | Measured |
|---|---|
Depth 1: children(first:50), 2 row fields + template{name} | too complex. first:10 resolves. |
Depth 3, three nested children(first:N) | The limit is the product of the three first values: about 15 passes (5·1·3), 16 fails (4·2·2), whichever level carries the weight. |
| Rows at real counts | Complexity tracks row fields × first. A 9-field row union failed at first:14; 8 selections held at first:16. Field types weigh differently: a 7-field row topped out at 14, a 4-field row at 21. |
field(name:){jsonValue} selections | About 11 per query (11 passes, 12 fails) before "Query is too nested … Depth is 17", whatever first is. |
Three sibling children connections | "Depth is 18 … maximum 15", whatever the field count. The depth ceiling is 15. |
children nested two levels inside a ComponentQuery | Fails silently. The rendering arrives with isContentResolved: false, no fields and no error, because the SDK swallows it. The same query succeeds as a standalone client.getData. |
A standalone 2-level getData (groups × links) | Groups × links up to about 22 passed (1×22, 2×11, 3×7, 4×5); 2×12, 3×8 and 4×6 failed. |
What follows from the table:
ComponentQuery to one level of children. Fetch deeper rows server-side with client.getData, one call per parent, in parallel.first must be strictly greater than the authored row count. Edge returns the first N rows with no error, so a row an author adds past first is silently dropped from the page. When the budget cannot hold that headroom, move secondary fields (images, logos, labels) to a server-side fetch. If the field set cannot shrink further, record the ceiling as the list's maximum authorable row count.Endpoints like /v1/content/api/graphql/v1/schema and ?query=schema both return {"errors":[{"message":"No query was provided!"}]}. The only way to get type info is per-type introspection via POST.
# Single type (e.g., Item)
curl -s -X POST "$EDGE_URL?sitecoreContextId=$CTX" \
-H "Content-Type: application/json" \
--data '{"query":"{ __type(name: \"Item\") { name kind fields { name description args { name type { name kind } } type { name kind ofType { name kind } } } } }"}'
The canonical type list to capture for an edge-snapshot/:
| File | Type |
|---|---|
type-LayoutData.json | LayoutData |
type-Item.json | Item |
type-ItemField.json | ItemField |
type-RoutesResult.json | RoutesResult |
type-SearchPredicate.json | SearchPredicate |
type-SiteData.json | SiteData |
type-SiteInfo.json | SiteInfo |
These cover the head-app-relevant surface. Add others (ItemTemplate, ItemLanguage, ItemUrl, etc.) if your work needs them.
curl -s -X POST "$EDGE_URL?sitecoreContextId=$CTX" \
-H "Content-Type: application/json" \
--data '{"query":"{ site { allSiteInfo { total results { name hostname language rootPath } } } }"}'
first: 10)curl -s -X POST "$EDGE_URL?sitecoreContextId=$CTX" \
-H "Content-Type: application/json" \
--data '{"query":"{ site { siteInfo(site: \"<siteName>\") { name rootPath routes(first: 10, language: \"en\") { total results { routePath } } } } }"}'
Argument gotchas (will silently confuse you if you guess):
siteInfo takes site: String! (NOT name: String!).routes takes language: String! REQUIRED (omitting it returns an error).after: "<cursor>" from the previous page's pageInfo.endCursor.curl -s -X POST "$EDGE_URL?sitecoreContextId=$CTX" \
-H "Content-Type: application/json" \
--data '{
"query": "query ($routePath: String!, $language: String!, $siteName: String!) { layout(routePath: $routePath, language: $language, site: $siteName) { item { rendered } } }",
"variables": { "routePath": "/", "language": "en", "siteName": "training" }
}'
item.rendered is opaque JSON (no GraphQL type — see content-sdk-resolver-patterns for what's inside). Save the raw response to layouts/<page-or-pattern>.json.
For probing multiple patterns, capture one layout per page that demonstrates a distinct delivery model:
layouts/components-standard-datasource.json (a page using a standard datasource rendering)layouts/components-all-fields-datasource.json (a page using the field-type-catalog rendering)layouts/components-integratedgraphql.json (a page using an Integrated GraphQL rendering)layouts/components-content-resolvers.json (a page using one or more content resolvers)scripts/capture-edge.mjs writes the canonical edge-snapshot/ layout — per-type introspection, sites.json, routes.json (every page, paginated with after), one layouts/<route>.json per route — with no dependencies beyond Node 18:
SITECORE_EDGE_CONTEXT_ID=… node scripts/capture-edge.mjs --site <siteName> [--language en] [--out edge-snapshot] [--max-routes 50]
It pages routes 10 at a time: on its first live run first: 50 + pageInfo was rejected as "Query is too complex to execute" (2026-09-16) — the § 2 limit, reproduced. Exit 1 on any Edge error; the erroring response is still written so the limit that fired is inspectable.
/schema URL.sitecoreContextId in the query string IS the auth. Putting Authorization: Bearer … is silently ignored.first: 10 is the safe default for routes.siteInfo(site: …), not siteInfo(name: …). Easy to misremember from the response shape.routes(…, language: "<lang>") is REQUIRED. Omitting it returns a missing-arg error, not an empty result.item.rendered is opaque JSON — there's no GraphQL type for what's inside. Use content-sdk-resolver-patterns to interpret..env.local — the contextId there is project-specific. Document only in .env.example.allSiteInfo and siteInfo.routes in one query — both work alone, together they trip complexity limits. Split into two POSTs.first: 100 even if the site has 4 routes — the complexity calculation is based on the cap, not the actual count.edge-snapshot/ which IS committed; treat them as public-visible content.{"data":{"__schema":{"queryType":{"name":"Query"}}}} for the smoke query { __schema { queryType { name } } }.{"data":{"__type":{"name":"<Type>","kind":"OBJECT|INTERFACE","fields":[...]}}}. An empty __type (null) means the type doesn't exist on this tenant.{"data":{"layout":{"item":{"rendered":{"sitecore":{"context":...,"route":...}}}}}}. An empty route means the path doesn't exist or isn't published.content-sdk-playground-pattern — the workspace layout that consumes edge-snapshot/.content-sdk-debug-layout-probe — for capturing layout responses through the head app's /api/layout-debug route (alternative to direct curl when the SDK's pre-processing matters).content-sdk-resolver-patterns — for interpreting item.rendered once you have it.sitecoreai-graphql-schemas — the broader catalog of types across Authoring + Edge endpoints.@sitecore-content-sdk/core/dist/cjs/constants.js → SITECORE_EDGE_PLATFORM_URL_DEFAULT = 'https://edge-platform.sitecorecloud.io'.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub chris1415/sitecore-skills-pocs --plugin sitecore-platform17 skills in this plugin
/sitecoreai-agentSitecoreAI Agent API: high-level REST actions such as create page with components, create personalization version and generate brief. Use as the default entry point for apps, MCP servers or automations. It powers the Marketer MCP./sitecoreai-authOAuth client-credentials auth for the SitecoreAI APIs (Agent, Pages, Publishing, Sites): automation client, token endpoint, scopes, env vars, caching, 401s. Load before the first API call. Not head-app Edge context ids./sitecoreai-brand-voiceWrites Sitecore page content in a brand's voice and identity, taken from the PRD or spec or a Sitecore brand kit, never guessed. Sets register (brand, marketing, technical-neutral). Use for copy on a brand or client site. Not page structure./sitecoreai-cli-cloud-workflowSitecore CLI against a SitecoreAI tenant: login, project and environment lookup, connect, ser pull and push, and their silent traps. Use when pulling, pushing or moving a site between tenants, or on CLI environment errors./sitecoreai-content-compositionInventory-first page composition via the Marketer MCP: inventory the site's real components, then compose a page by choosing and ordering them, with the verified add-component recipe. Use when authoring or extending a page, not a single field./sitecoreai-edge-admin-webhooksExperience Edge Admin API: admin client, token, webhook CRUD (OnEnd vs OnUpdate), settings, cache clear, which webhook fits which job. Use when registering, testing or debugging a publish webhook. Not head-app revalidation code.Other plugins' skills for the same job