younifyd
Menu

productProjectionVariantAttributes

The attribute definitions available on product projection variants, for building search filters/facets.

Use it in a workflow

  1. Add a step and choose the Commercetools connector.
  2. Pick the productProjectionVariantAttributes action (under Product).
  3. Fill in the fields below, then reference the result from later steps as {{productprojectionvariantattributes.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.

graphql
query ProductProjectionVariantAttributes($id: String, $key: String, $staged: Boolean!, $includeAttributeNames: [String!]!, $localeProjection: [Locale!], $includeChannelIds: [String!]) {
  productProjectionVariantAttributes(
    id: $id
    key: $key
    staged: $staged
    includeAttributeNames: $includeAttributeNames
    localeProjection: $localeProjection
    includeChannelIds: $includeChannelIds
  ) {
    productId
    productKey
    attributes {
      name
      type
      labelAllLocales {
        locale
        value
      }
    }
    variants {
      id
      sku
      key
      availability {
        noChannel
        channels
      }
      attributesRaw {
        name
        value
        attributesRaw
        referencedResource
        referencedResourceSet
      }
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

idstring

Queries with specified ID

keystring

Queries with specified key

stagedbooleanrequired
includeAttributeNamesarray<string>required

The names of the attributes to include. At least one needs to be specified.

localeProjectionarray<string>
includeChannelIdsarray<string>

The IDs of channels to include. If no channels is provided only the `noChannel` is returned.

json
{
  "staged": false,
  "includeAttributeNames": [
    "string"
  ],
  "id": "string",
  "key": "string",
  "localeProjection": [
    "string"
  ],
  "includeChannelIds": [
    "string"
  ]
}

Response

Read the result with {{productprojectionvariantattributes.response.data.data.productProjectionVariantAttributes}}. If the API returns errors, the step fails and they are at {{productprojectionvariantattributes.response.data.errors}}.

productIdstring
productKeystring
attributesarray<object>
nameobject
typeobject
labelAllLocalesobject
variantsarray<object>
idobject
skuobject
keyobject
availabilityobject
attributesRawobject

Need more? See the Commercetools guide for connection setup and behaviour shared by every action.

productProjectionVariantAttributes — Commercetools — Documentation