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=[shop.OWNER,shop.EDITOR] 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 the identifier of an existing favorite list. Two formats are accepted and both remain valid: a 24-character hexadecimal id (lists created before the PostgreSQL migration) or a UUID (lists created after it). The format is validated automatically and will return an error for anything else.
Validation constraints:
- Required field (cannot be null or empty)
- Must be a 24-character hexadecimal id or a UUID
- 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