GraphQL queries call using Sling servlet and models

Avatar

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

122 likes

Total Posts

403 posts

Correct reply

65 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

122 likes

Total Posts

403 posts

Correct reply

65 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile
Prince_Shivhare
Level 7

20-02-2021

Hi Team,

 

I want to send the GraphQL queries to Magento and then Magento sends back a response.

 

can anyone help me how I can achieve this by using sling servlet and models.

 

I investigated about it but haven't found anything in google.

 

Thanks,

Prince

 

@mhaack @dgordon86 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
raj_mandalapu
MVP

Likes

125 likes

Total Posts

203 posts

Correct reply

72 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
MVP
raj_mandalapu
MVP

Likes

125 likes

Total Posts

203 posts

Correct reply

72 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Give Back 5
Give Back 3
View profile
raj_mandalapu
MVP

20-02-2021

@Prince_Shivhare the POC which I did an year back should help you ,check below article.

http://www.coderss.in/read-magento-product-data-via-graphql-in-aem/

 

Answers (1)

Answers (1)

Avatar

Avatar
Give Back 5
Employee
mhaack
Employee

Likes

17 likes

Total Posts

18 posts

Correct reply

6 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile

Avatar
Give Back 5
Employee
mhaack
Employee

Likes

17 likes

Total Posts

18 posts

Correct reply

6 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile
mhaack
Employee

22-02-2021

Hi @Prince_Shivhare  this is easy to solve 🙂

 

The entire CIF Core Components project is your example. It provides the graphql client (which is independent form the backend) which accepts any GraphQL query. For Magento we provide addition helpers and a full step of data model classes representing the Magento Schema. This allows you to work with Java objects instead with GraphQL query strings. For example the product teaser component https://github.com/adobe/aem-core-cif-components/blob/master/bundles/core/src/main/java/com/adobe/cq... 

 

My colleague Mark and me did a tech talk during last adapt.to conf and CIF GraphQL usage and customization: https://adapt.to/2020/en/schedule/graphql-services-in-the-aem-world.html

 

Markus