GraphQL Query to fetch a content fragment matching a property value | Community
Skip to main content
Adobe Champion
December 20, 2022
Solved

GraphQL Query to fetch a content fragment matching a property value

  • December 20, 2022
  • 1 reply
  • 1214 views

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?

 

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

@p_v_nair These sample queries should help you

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-api/sample-queries.html?lang=en#sample-all-cities-san-ignore-case

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

1 reply

krati_garg
Adobe Employee
krati_gargAdobe EmployeeAccepted solution
Adobe Employee
December 20, 2022

@p_v_nair These sample queries should help you

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-api/sample-queries.html?lang=en#sample-all-cities-san-ignore-case

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

P_V_NairAdobe ChampionAuthor
Adobe Champion
December 20, 2022

@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