GraphQL request to apply merged conditions
Use the contextData parameter in a query to pass conditions. In a content query, add this parameter to a componentPresentation() or page() query; in a Taxonomy query, add this parameter to a keyword() or categories() call.
Here are examples of content queries:
{
componentPresentationQueryExample: componentPresentation(namespaceId: 2, publicationId: 4144304, componentId: 164206, templateId: 997856,
contextData: [{uri: "taf:ish:userconditions:merged",
type: STRING,
value: "{\"HEADSET\":[\"Y\"]}"}]) {
id
rawContent(renderContent: true) {
content
}
}
pageQueryExample: page(namespaceId: 2, publicationId: 4144304, pageId: 164155,
contextData: [{uri: "taf:ish:userconditions:merged",
type: STRING,
value: "{\"HEADSET\":[\"Y\"]}"}]) {
rawContent(renderContent: true) {
content
}
}
}
Here are examples of Taxonomy queries.
{
keywordQueryExample: keyword(namespaceId: 2, publicationId: 39137, categoryId: 1, keywordId: 10,
contextData: [{uri: "taf:ish:userconditions:merged",
type: STRING,
value: "{\"HEADSET\":[\"Y\"],\"SIM\":[\"Y\"],\"LOUDSPEAKER\":[\"Y\"],\"GAMES\":[\"DJ\",\"SNAKE\",\"WATERRAPIDS\"],\"MODEL\":[\"330\"],\"GPRS\":[\"Y\"],\"GPS\":[\"Y\",\"N\"],\"BLUETOOTH\":[\"Y\"],\"REJECTCALL\":[\"ENABLED\"]}"}]) {
publicationId
itemId
key
name
taxonomyId
}
categoriesQueryExample: categories(namespaceId: 2, publicationId: 39137,
contextData: [{uri: "taf:ish:userconditions:merged",
type: STRING,
value: "{\"HEADSET\":[\"Y\"],\"SIM\":[\"Y\"],\"LOUDSPEAKER\":[\"Y\"],\"GAMES\":[\"DJ\",\"SNAKE\",\"WATERRAPIDS\"],\"MODEL\":[\"330\"],\"GPRS\":[\"Y\"],\"GPS\":[\"Y\",\"N\"],\"BLUETOOTH\":[\"Y\"],\"REJECTCALL\":[\"ENABLED\"]}"}]) {
edges {
node {
publicationId
itemId
key
name
taxonomyId
}
}
}
}
The above query causes all returned root entities and child taxonomies to be filtered by applying the condition values passed in the contextData parameter.