12 July 2022
Composable Commerce
HTTP API
Enhancement
Audit LogProduct catalogGraphQL

We have extended the capabilities of Audit Log to include the tracking of changes made on Product Selections. With this enhancement, all Changes performed on Product Selections are tracked from now on and these Changes are now retrievable via API.

Changes:

  • [API] Added the view_product_selections:{projectKey} scope.
  • [API] Added product-selection to ChangeHistoryResourceType.
  • [API] Added AddProductChange.
  • [API] Added RemoveProductChange.
  • [API] Added SetProductCountChange.
  • [GraphQL API] Added the following types to the graphQL schema: ProductSelectionChangeInput.
  • [GraphQL API] Added queries productSelection and productSelections.
  • [GraphQL API] Added ProductSelection to the ResourceType enum.

Additional changes:

The following change was introduced in terms of GraphQL SDL:

  productSelections(
    date: DateRange
    limit: Int
    offset: Int
    source: Source
    type: Type
    clientId: String
    userId: String
    customerId: String
    changes: [ProductSelectionChangeInput!]
    expand: Boolean
    stores: [String!]
  ): ChangeHistoryQueryResults!
    @auth(permissions: [view_audit_log, view_product_selections])
  productSelection(
    id: String!
    date: DateRange
    limit: Int
    offset: Int
    source: Source
    type: Type
    clientId: String
    userId: String
    customerId: String
    changes: [ProductSelectionChangeInput!]
    expand: Boolean
    stores: [String!]
  ): ChangeHistoryQueryResults!
    @auth(permissions: [view_audit_log, view_product_selections])

  enum ProductSelectionChangeInput {
    setKey
    changeName
    setCustomType
    setCustomField
    setProductCount
    addProduct
    removeProduct
  }