Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Customizing CIF Product Component to Query Custom Properties/Objects in AEM | AEM Community Blog Seeding

kautuk_sahni
Community Manager
Community Manager

BlogImage.jpg

Customizing CIF Product Component to Query Custom Properties/Objects in AEM by Bimmi Soi

Abstract

Understanding and modifying the GraphQL queries is one of the key ways in which the CIF Core Components can be extended.

Your custom query :

{
products(
filter: { sku: { eq: "YOUR_SKU" } }
) {
items {
name
sku
customProperty
customObject{
name,
code
}
}
}
}
Response :
{
"data": {
"products": {
"items": [
{
"name": "Product Name",
"sku": "sku",
"customProperty":"customVariableValue",
"customObject": {
"name": "nameValue",
"code": "codeValue",
}
}
]
}
}
}
In order to achieve that AbstractQuery (com.shopify.graphql.support.AbstractQuery) abstract class provides two methods to query custom property and object respectively.
addCustomSimpleField(String fieldName);
addCustomObjectField(String fieldName, CustomFieldQueryDefinition queryDef);

Read Full Blog

Customizing CIF Product Component to Query Custom Properties/Objects in AEM

Q&A

Please use this thread to ask the related questions.

0 Replies