[GraphQL] Calling GraphQL endpoint programatically from within AEM (OSGi bundles) | Community
Skip to main content
New Participant
May 23, 2022

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

  • May 23, 2022
  • 2 replies
  • 1460 views

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/ 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

baoyu_liAuthor
New Participant
May 23, 2022

thanks @mayank_gandhi. our of curiosity, did you also considered HTTP Client Factory in AEM? https://kiransg.com/2021/11/08/aem-invoke-api-how-to-use-http-client-factory/ 

Bhuwan_B
New Participant
May 23, 2022

@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-fragments-in-aem.html#.Yotpj5NBxhE

baoyu_liAuthor
New Participant
May 23, 2022

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