GraphQL Client | Community
Skip to main content
sreedobe
Level 4
Mar 18, 2021 10:54 PM UTC
Solved

GraphQL Client

I have graphQL Services at client place and would like to consume the services using GraphQL Client api provided by adobe, as application is an aem application.

 

I tried by including below maven dependency in core/bundle, ui.apps and parent pom files. I am not able to see GraphQL Factory config or bundle downloaded.

 

I tried both below dependencies with / without scope.

 

<dependency>
<groupId>com.adobe.commerce.cif</groupId>
<artifactId>graphql-client</artifactId>
<version>1.7.1</version>
<scope>provided</scope>
</dependency>

 


<dependency>
<groupId>com.adobe.commerce.cif</groupId>
<artifactId>graphql-client</artifactId>
<version>1.7.1</version>
</dependency>

 

Thanks,

Sree 

bilal_ahmad
bilal_ahmadAccepted solution
Level 5
Mar 19, 2021 7:03 AM UTC

Hey @sreedobe add the dependencies in your budle pom.xml and parent pom.xml. Also add this in your bundle pom.xml in the configuration:

<configuration> <bnd><![CDATA[ -conditional package: com.adobe.commerce.cif .. .. ]]></bnd> </configuration>

  

I hope this works out for you!

Thanks,

Bilal.

2 replies

Vijayalakshmi_S
Level 10
Mar 19, 2021 3:16 PM UTC

Hi @sreedobe,

Adding dependency in POM files will help resolve at AEM maven project level. When the same is deployed in an AEM instance, added dependencies should be available as OSGI bundle. 

In order to do this, in addition to adding desired dependency in parent pom.xml and in core/pom.xml file,

  • If you are using maven-bundle-plugin to build your core module, use below lines in <instructions>
    • <Embed-Dependency>*;inline=true</Embed-Dependency>
      <Embed-Transitive>true</Embed-Transitive>
  • If you are using bnd-maven-plugin to build your core module, use below within <bnd><![CDATA[ section
    • -conditionalpackage : com.adobe.commerce.cif  (desired dependency's groupId and -condiionalpackage without space)
Translate
bilal_ahmad
bilal_ahmadAccepted solution
Level 5
Mar 19, 2021 7:03 AM UTC

Hey @sreedobe add the dependencies in your budle pom.xml and parent pom.xml. Also add this in your bundle pom.xml in the configuration:

<configuration> <bnd><![CDATA[ -conditional package: com.adobe.commerce.cif .. .. ]]></bnd> </configuration>

  

I hope this works out for you!

Thanks,

Bilal.

Translate