Skip to content

commerce-docs/commerce-webapi

 
 

Repository files navigation

Adobe Commerce Web API Documentation

This repository contains the code for the Commerce Web API documentation website. It is built using Adobe Edge Delivery Services and deployed to Adobe Developer.

The site covers REST, GraphQL, and SOAP APIs for Adobe Commerce and Magento Open Source, including API reference documentation for multiple release versions.

Quick start

For local development, you need to start three servers:

  1. Content server (this repo):

    npm run dev
  2. Code server (adp-devsite):

    git clone https://github.com/AdobeDocs/adp-devsite
    cd adp-devsite
    npm install
    npm run dev
  3. Runtime connector (devsite-runtime-connector):

    git clone https://github.com/aemsites/devsite-runtime-connector
    cd devsite-runtime-connector
    npm install
    npm run dev

Once all three servers are running, navigate to http://localhost:3000/commerce/webapi.

For common utilities and documentation, see the centralized README.

Testing and linting

Markdown linting

To lint Markdown files before pushing:

npm run lint:md

To automatically fix linting errors:

npm run lint:md:fix

Content validation

To check internal and external links, validate front matter, and more:

npm run lint

TOC validation

To validate the table of contents file:

npm run test:config

GraphQL API reference

The GraphQL API reference is generated using SpectaQL. It reads local introspection schema files, applies a custom Markdown-output theme, and writes the result to src/pages/includes/autogenerated/. Each generated file is included in the API reference pages via <Fragment>.

Generating the reference

To regenerate all schema versions:

npm run generate:graphql-api-docs

To regenerate a specific 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:saas

See spectaql/README.md for full configuration and script documentation.

How to get the schema

The schema files in spectaql/ are GraphQL introspection results retrieved from a running Adobe Commerce instance using apollo-cli:

npx apollo-cli download-schema $ENDPOINT_URL --output schema_X.Y.Z.json

where $ENDPOINT_URL is the GraphQL endpoint of the target Commerce instance. Replace X.Y.Z with the appropriate version (for example, 2.4.9) and place the file in the spectaql/ directory before regenerating.

Contributors

Languages

  • JavaScript 85.3%
  • Handlebars 14.7%