Skip to main content

favoriteListAddItems

Add products and clusters to a favorite list.

Associates individual products and/or product clusters with the specified favorite list, enabling users to save items for later reference or purchase.

Addition process includes:

  • Validation of all provided product and cluster references
  • Duplicate detection and prevention within the list
  • Atomic operation ensuring data consistency
  • Automatic deduplication of existing items

Items can be specified using either internal IDs or external source references, but not both formats simultaneously. The operation is additive - existing items in the list remain unchanged.

Supported item types:

  • Products: Individual product entities referenced by ID or external source
  • Clusters: Product cluster entities referenced by ID or external source
  • Mixed: Both products and clusters can be added in the same operation

Validation constraints:

  • All product IDs must reference existing products in the system
  • All cluster IDs must reference existing clusters in the system
  • Array fields must contain unique values (duplicates are automatically removed)
  • External source references must have valid name and ID format

Possible errors:

  • FAVORITE_LISTS_NOT_FOUND_ERROR: Favorite list with the specified ID does not exist
  • FAVORITE_LISTS_INVALID_INPUT_ERROR: Invalid item references or validation failure
  • FAVORITE_LISTS_UNKNOWN_ERROR: Unexpected system error during item addition

AUTH: Role=[system] OR ('user is authenticated')

favoriteListAddItems(
id: String!
input: FavoriteListsItemsInput!
): FavoriteList!

Arguments

favoriteListAddItems.id ● String! non-null scalar

Unique identifier of the favorite list to modify.

Must be a valid MongoDB ObjectId string with length of 12 or 24 characters representing an existing favorite list. The ObjectId format is validated automatically and will return an error for invalid formats.

Validation constraints:

  • Required field (cannot be null or empty)
  • Must be valid ObjectId format (hexadecimal string)
  • Must reference an existing favorite list in the system

favoriteListAddItems.input ● FavoriteListsItemsInput! non-null input

Items to add to the favorite list.

Contains arrays of product IDs and/or cluster IDs to associate with the favorite list. All fields are optional, but at least one item type should be provided for meaningful operation.

Supported formats:

  • productIds: Array of internal product identifiers
  • productSources: Array of external product source references
  • clusterIds: Array of internal cluster identifiers
  • clusterSources: Array of external cluster source references

Validation rules:

  • Cannot mix ID and source formats for the same item type
  • All referenced entities must exist in the system
  • Duplicate values within arrays are automatically removed
  • Empty arrays are ignored

Type

FavoriteList object

Favorite list entity for GraphQL federation.

Represents a customer's favorite list containing saved products and clusters for easy access and future purchasing. Used for managing customer preferences and providing personalized shopping experiences across federated services.