Expand my Community achievements bar.

SOLVED

GraphQL Query to fetch a content fragment matching a property value

Avatar

Adobe Champion

Is it possible to query a particular content fragment inside a particular DAM path which matches a property value using GraphQL? Or is this a servlet side implementation?

 

For eg:

I need to query a content fragment(created using a particular model - /conf/test-inc/settings/dam/cfm/models/test-model) which resides inside the dam path - /content/dam/test-company/test-assets and matching a property(test-property = "123456") inside the master node of content fragment.

 

Is this possible using a Graph QL query? How will the query look like? Do we need to use nested query here?

 

This is what i tried and I get node traversal error. Is this query correct?

P_V_Nair_0-1671562134836.png

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@P_V_Nair These sample queries should help you

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...

query {
cityList(filter: {
name: {
_expressions: [
{
value: "SAN"
_operator: CONTAINS
_ignoreCase: true
}
]
}
}) {
items {
name
population
country
}
}
}

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

@P_V_Nair These sample queries should help you

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...

query {
cityList(filter: {
name: {
_expressions: [
{
value: "SAN"
_operator: CONTAINS
_ignoreCase: true
}
]
}
}) {
items {
name
population
country
}
}
}

Avatar

Adobe Champion

@krati_garg  Can you please help me here. Is cityList the content fragment model? I am looking forward to query a specific Content fragment matching a property value