Menu
variantProjection
A single product-projection variant by SKU or key.
Use it in a workflow
- Add a step and choose the Commercetools connector.
- Pick the variantProjection action (under Variant).
- Fill in the fields below, then reference the result from later steps as
{{variantprojection.response.data}}.
Query
This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.
query VariantProjection($id: String, $key: String, $sku: String, $staged: Boolean!, $localeProjection: [Locale!]) {
variantProjection(
id: $id
key: $key
sku: $sku
staged: $staged
localeProjection: $localeProjection
) {
id
staged
default
variantId
version
createdAt
productRef {
typeId
id
}
key
sku
images {
url
dimensions {
width
height
}
label
}
assets {
id
key
sources {
uri
key
dimensions
contentType
}
nameAllLocales {
locale
value
}
descriptionAllLocales {
locale
value
}
tags
custom {
typeRef
type
}
}
nameAllLocales {
locale
value
}
slugAllLocales {
locale
value
}
descriptionAllLocales {
locale
value
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"staged": false,
"id": "string",
"key": "string",
"sku": "string",
"localeProjection": [
"string"
]
}
Response
Read the result with {{variantprojection.response.data.data.variantProjection}}. If the API returns errors, the step fails and they are at {{variantprojection.response.data.errors}}.
Need more? See the Commercetools guide for connection setup and behaviour shared by every action.
Was this page helpful?