AEM GraphQL configuration issues

Last update: 2023-10-02

Description

Environment

Experience Manager

Issue/Symptoms

When developing a website that should retrieve data from its AEM (Adobe Experience Manager) instances using AEM headless solution, the tutorial in (1) was followed to set up the endpoint.

After publishing all the content fragments, models, content, references, assets, and queries as described in (2), when retrieving any content fragment from the publish instance, a 404 error is received, preventing the content from being read by the publisher.

(1) Defining Content Fragment Models in AEM Headless Tutorial

(2) ​​​​Author and Publish Architecture in AEM Headless Tutorial

Resolution

After checking the dispatcher logs, it was noticed that the request to the customer’s GraphQL endpoint - /content/cq:graphql/graphql/endpoint.json was blocked at the dispatcher level - (1).

The dispatcher needs to be configured to specifically allow persisted queries to the endpoint.
Please follow (2) for more details about how to configure the dispatcher.

(1)

aem_base_version: 6.5
    aem_envId: xxxxxxx
    aem_envType: dev
    aem_program_id: xxxxxx
    aem_release_id: xxxxx
    aem_service: cm-pxxxxxx-exxxxxxx
    aem_tenant: ns-team-aem-cm-prd-nxxxxxx
    aem_tier: publish
    backend: publishfarm/-
    cache: blocked
    cluster:
    code:-

    file_path: /var/log/aem/dispatcher.log
    host: publish-pxxxxxx-exxxxxxx.adobeaemcloud.com
    method: POST
    namespace: ns-team-aem-cm-prd-nxxxxxx
    orig_time: 25/Jul/2023:15:39:11 +0000
    path: /content/cq:graphql/graphql/endpoint.json
    pod_name:
    pod_uid:
    proto: HTTP
    proto_version: 1.1
    response_time: 0

(2)

Dispatcher - Endpoint configuration with AEM Headless

On this page