Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

[GraphQL] Calling GraphQL endpoint programatically from within AEM (OSGi bundles)

Avatar

Level 3

Hi All, 

 

We'd like to make calls to GraphQL endpoint programatically from within AEM (OSGi bundles).

Can help share how to best do it?

 

Should we use https://github.com/adobe/aem-headless-client-java?  Is this Java client designed to be used inside AEM or outside AEM?

Or what about using HTTP Client Factory in AEM? https://kiransg.com/2021/11/08/aem-invoke-api-how-to-use-http-client-factory/ 

5 Replies

Avatar

Community Advisor

@baoyu_li you can use GraphiQL Interface to directly input, and test queries (The interface should be installed separately, the interface can be downloaded from Adobe software distribution).

https://www.albinsblog.com/2021/10/how-to-deliver-headless-content-through-graphql-api-and-content-f...

Avatar

Level 3

thanks @Bhuwan_B , but we want to call it programatically using Java in AEM.