SEARCH & AI / 009

GraphQL vs Sling Model Exporter for AI Ingestion

A comparison framework for selecting an AEM content API for AI ingestion, including schema stability, access boundaries and consumer coupling.

SHARE
LinkedIn X Facebook Threads

Topic map

Choose the extraction contract

AEM GraphQL AI ingestion

  1. 01Content model
  2. 02API shape
  3. 03Normalize
  4. 04Provenance
  5. 05Ingest

SYSTEM OVERVIEW

SYSTEM / FLOW

Two API contracts can feed one normalization boundary.

An illustrative comparison; the chosen endpoint and behavior must be checked against the target AEM implementation.

CONTENT FRAGMENT GRAPHQLFragment modelExplicit queryStructured fieldsSLING MODEL EXPORTERResource /componentExported SlingModelModel JSONCOMBINED PATHNormalize sourcecontractValidateprovenanceIngestion

Content Fragment GraphQL

  1. Fragment model
  2. Explicit query
  3. Structured fields

Sling Model Exporter

  1. Resource / component
  2. Exported Sling Model
  3. Model JSON

Combined path

  1. Normalize source contract
  2. Validate provenance
  3. Ingestion

THIS ARTICLE EXPLORES

  1. Distinguish content-model APIs from component-oriented exports.
  2. Keep ingestion independent of presentation changes.
  3. Validate pagination, references and access behavior.

01 / PROBLEM

Choose the owner of the data shape.

A GraphQL contract can describe structured content independently of page composition. A model export reflects the model the application exposes. Either may be valid; the question is whether presentation changes should require ingestion changes.

Contract choice
ConcernContent Fragment GraphQLSling Model Exporter
Source structureContent Fragment Model fields.Exported model properties.
Change ownershipContent model and query versioning.Application model and serializer behavior.
Consumer fitStructured content consumers.Existing resource/component APIs.
Risk to testReference expansion and pagination.Presentation coupling and missing provenance.

02 / IMPLEMENTATION

Normalize into an application-owned document.

Avoid passing the raw response directly to a chunker. Map stable identity, locale, revision and permitted fields into a reviewed internal contract. The shapes below are deliberately simplified illustrations, not requests guaranteed to run against an arbitrary AEM instance.

Two source shapes; one normalization target

JSON / illustrative
{
  "graphqlLike": {
    "data": {
      "guideByPath": {
        "item": {
          "title": "Example guide",
          "body": "Approved text"
        }
      }
    }
  },
  "exporterLike": {
    "title": "Example guide",
    "body": "Approved text",
    ":type": "example/components/guide"
  },
  "normalized": {
    "sourceId": "resolved-stable-id",
    "locale": "en",
    "revision": "resolved-revision",
    "text": "Approved text"
  }
}

03 / INGESTION

An extraction endpoint is not a change feed.

Decide how initial enumeration, pagination and publication changes are detected. A cached query result can be suitable for content delivery without being a complete ingestion checkpoint. Confirm how unpublish and delete events become removal instructions.

Contract validation

Record endpoint behavior rather than assuming parity between APIs.

  1. 01Enumerate sources
  2. 02Read fields
  3. 03Resolve references
  4. 04Record revision
  5. 05Reconcile missing sources

04 / FAILURE MODES

Test schema and policy changes together.

A newly exported field can be syntactically valid and still be inappropriate for retrieval. Treat field selection as an allowlist. Do not broaden ingestion access merely to make a failed query succeed.

Change cases
ChangeFailureValidation
Field removedNormalizer silently loses evidence.Schema fixture fails explicitly.
Reference cycleExpansion repeats or grows without bound.Depth and visited-source limits.
Locale variantIdentity collision across languages.Independent locale keys.
Source withdrawnCached data survives in search.End-to-end removal test.

05 / TRADEOFFS

Prefer the contract you can govern.

Reuse an existing export only when its stability and access boundaries fit the use case. Choose a structured-content API when it reduces coupling, not because GraphQL is inherently more suitable for AI.

Selection evidence

  • A reviewed source-to-normalized mapping.
  • Fixtures for absent fields and reference failures.
  • Pagination and revision semantics documented.
  • A tested deletion and permission-change path.

REFERENCE DESK

Sources & further verification

Product behavior should be checked against the target AEM and search-engine release. The design choices in this note are proposed assessment criteria, not vendor guarantees.

SHARE THIS NOTE

Found this useful? Share it with someone working on AEM, platform engineering or search.

SHARE
LinkedIn X Facebook Threads

CONTINUE THE THREAD

Related engineering notes

Related engineering work