Cross-Origin Resource Sharing (CORS) configuration

If caching in the Dispatcher has been enabled then the CORS Filter is not needed, and so this section can be ignored.
For a detailed overview of the CORS resource sharing policy in AEM see Understand Cross-Origin Resource Sharing (CORS).

To access the GraphQL endpoint, a CORS policy must be configured and added to an AEM Project that is deployed to AEM via Cloud Manager. This is done by adding an appropriate OSGi CORS configuration file for the desired endpoint(s). Multiple CORS configurations can be created and deployed to different environments. Examples can be found in the WKND Reference Site

The CORS configuration must specify a trusted website origin alloworigin or alloworiginregexp for which access must be granted.

The configuration file must be named like: com.adobe.granite.cors.impl.CORSPolicyImpl~appname-graphql.cfg.json where appname reflects the name of your application.

For example, to grant access to the GraphQL endpoint /content/cq:graphql/wknd/endpoint and persisted queries endpoint for https://my.domain you can use:


If you have configured a vanity path for the endpoint, you can also use it in allowedpaths.