This directory contains SpectaQL configuration files for generating the Adobe Commerce GraphQL API reference as Markdown fragments embedded in the documentation site via Edge Delivery Services.
- Node.js matching the version in
.nvmrc - npm
| File | Role |
|---|---|
config.yml |
SpectaQL config for the latest (2.4.9) schema (schema.json → split chunk files). |
config_2-4-8.yml |
SpectaQL config for the 2.4.8 schema. |
config_2-4-7.yml |
SpectaQL config for the 2.4.7 schema. |
config_2-4-6.yml |
SpectaQL config for the 2.4.6 schema. |
config_saas.yml |
SpectaQL config for the Adobe Commerce as a Cloud Service schema. |
schema.json |
GraphQL introspection result — latest (2.4.9). |
schema_2-4-8.json |
GraphQL introspection result — 2.4.8. |
schema_2-4-7.json |
GraphQL introspection result — 2.4.7. |
schema_2-4-6.json |
GraphQL introspection result — 2.4.6. |
schema_saas.json |
GraphQL introspection result — Adobe Commerce as a Cloud Service. |
markdown-theme/ |
Custom SpectaQL Handlebars theme that outputs a plain Markdown fragment instead of HTML. |
markdown-grunt-config.js |
Custom grunt task config that disables SpectaQL's HTML prettifier, which would otherwise collapse the Markdown output to a single line. |
scripts/generate-spectaql-md.js |
Build script. Runs SpectaQL once per schema, splits the output into per-section chunk files, removes SpectaQL's JS/CSS asset output, and syncs the reference pages that embed each chunk via a single Fragment include. |
The script reads each local introspection file, runs SpectaQL with a custom Markdown-output theme, and splits the monolithic output into smaller chunk files written to src/pages/includes/autogenerated/. Each chunk is embedded in its own reference page via a single Fragment directive that the script maintains automatically:
<!-- src/pages/reference/graphql/latest/index.md -->
<Fragment src="../../../includes/autogenerated/graphql-api-2-4-9-queries.md" />
<!-- src/pages/reference/graphql/latest/mutations.md -->
<Fragment src="../../../includes/autogenerated/graphql-api-2-4-9-mutations.md" />
<!-- src/pages/reference/graphql/latest/types-a-b.md -->
<Fragment src="../../../includes/autogenerated/graphql-api-2-4-9-types-a-b.md" />
…The deployment system imposes a size limit on individual Markdown files, and loading every chunk on one page defeats the purpose of splitting. Types are therefore split into fixed alphabetical ranges (types-a-b, types-c-e, types-f-i, types-k-p, types-q-s, types-t-z), each mapped to its own reference page. Queries and mutations are separate pages as well.
To regenerate all schema versions:
npm run generate:graphql-api-docsTo regenerate a single version:
npm run generate:graphql-api-docs:2.4.9
npm run generate:graphql-api-docs:2.4.8
npm run generate:graphql-api-docs:2.4.7
npm run generate:graphql-api-docs:2.4.6
npm run generate:graphql-api-docs:saasWhat happens for each schema:
- Any existing chunk files for that version (
graphql-api-X-Y-Z-*.md) are deleted so stale files do not persist if the schema shrinks. - SpectaQL reads the local schema file using the corresponding
config_*.yml. - The custom
markdown-theme/Handlebars templates render a single Markdown document. - The custom
markdown-grunt-config.jsbypasses the HTML prettifier. - SpectaQL's JS/CSS asset directories are removed from the output directory.
- The document is split by H2 section into
*-queries.md,*-mutations.md, and (if present)*-subscriptions.md. - The types section is split into fixed alphabetical ranges:
*-types-a-b.md,*-types-c-e.md,*-types-f-i.md,*-types-k-p.md,*-types-q-s.md, and*-types-t-z.md(split at H3 boundaries). - The script writes or updates separate reference pages under
src/pages/reference/graphql/(index.md,mutations.md, andtypes-*.md) so each page embeds exactly one chunk file.
If a schema changes:
-
Replace the relevant
schema_X.Y.Z.jsonwith the updated introspection result. -
Create a branch from
mainand regenerate only that version:npm run generate:graphql-api-docs:X.Y.Z
-
Review the updated chunk files in
src/pages/includes/autogenerated/and the updated reference pages in the correspondingsrc/pages/reference/graphql/directory. -
Commit all changed files (chunk files + reference pages if the page layout changed).
-
After the PR is approved and merged, the updated reference is published automatically via EDS.
- Drop the introspection file into
spectaql/schema_X.Y.Z.json. - Copy
config_2-4-8.ymltoconfig_X.Y.Z.ymland updateintrospectionFile,targetFile,version, andtitle. - Add an entry (with
version,config, andindexDirfields) to theschemasarray inscripts/generate-spectaql-md.js. - Add a
generate:graphql-api-docs:X.Y.Zscript topackage.json. - Create
src/pages/reference/graphql/X-Y-Z/index.mdwith the appropriate frontmatter and heading (no Fragment lines needed — the script writes the reference pages on first run). - Add the version's sub-pages to
src/pages/config.md(queries, mutations, and the six types ranges). - Run
npm run generate:graphql-api-docs:X.Y.Zand commit the result.
- The
mdTypeLinkhelper override inmarkdown-theme/helpers/generates GFM-compatible#typenameanchors instead of SpectaQL's default#definition-TypeNameformat, which requires<a>tags not supported by EDS. - Sass
@importdeprecation warnings during the build are cosmetic and do not affect output.