Skip to main content

FavoriteList

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.

type FavoriteList {
id: ID!
name: String!
companyId: Int
contactId: Int
customerId: Int
isDefault: Boolean!
slug: String!
createdAt: DateTime!
updatedAt: DateTime!
products(
input: ProductSearchInput
): ProductsResponse
clusters(
input: ProductSearchInput
): ProductsResponse
company: Company
contact: Contact
customer: Customer
}

Fields

FavoriteList.id ● ID! non-null scalar

Unique identifier for the favorite list.

This is a MongoDB ObjectId that serves as the primary key for the favorite list. Use this ID for all operations that reference this specific favorite list. The ID is automatically generated when the list is created and cannot be changed.

Format: 24-character hexadecimal string (e.g., "67d2a7d52dfe2a405d3bd5b9")

FavoriteList.name ● String! non-null scalar

The descriptive name of the favorite list.

This name helps users identify the purpose and content of the list. A URL-friendly slug is automatically generated from this name.

Validation constraints:

  • Required field (cannot be empty)
  • Maximum length: 64 characters
  • Must be unique within the owner's scope (company, contact, or customer)
  • Supports Unicode characters for international use

The name is used for:

  • Display in user interfaces
  • Automatic slug generation for URLs
  • Search and filtering operations
  • Uniqueness validation within owner scope

FavoriteList.companyId ● Int scalar

The unique identifier of the company that owns this favorite list.

When present, this favorite list belongs to the specified company. Only one of companyId, contactId, or customerId can be set.

Validation constraints:

  • Must be a positive integer
  • Must reference an existing company in the system
  • Mutually exclusive with contactId and customerId
  • Cannot be changed after list creation

Use this for:

  • Company-specific product catalogs
  • B2B procurement lists
  • Corporate inventory management

FavoriteList.contactId ● Int scalar

The unique identifier of the contact that owns this favorite list.

When present, this favorite list belongs to the specified contact. Only one of companyId, contactId, or customerId can be set.

Validation constraints:

  • Must be a positive integer
  • Must reference an existing contact in the system
  • Mutually exclusive with companyId and customerId
  • Cannot be changed after list creation

Use this for:

  • Personal contact lists
  • Sales representative collections
  • Individual user preferences

FavoriteList.customerId ● Int scalar

The unique identifier of the customer that owns this favorite list.

When present, this favorite list belongs to the specified customer. Only one of companyId, contactId, or customerId can be set.

Validation constraints:

  • Must be a positive integer
  • Must reference an existing customer in the system
  • Mutually exclusive with companyId and contactId
  • Cannot be changed after list creation

Use this for:

  • Customer shopping lists
  • Personal product collections
  • End-user favorites and wishlists

FavoriteList.isDefault ● Boolean! non-null scalar

Indicates whether this favorite list is marked as a default list.

Default lists have special significance in the system and may be automatically selected or prioritized in user interfaces and business logic.

Validation constraints:

  • Must be a boolean value (true or false)
  • Default value: false
  • Only one default list per owner is typically allowed

Use cases for default lists:

  • Primary shopping list for customers
  • Main product catalog for companies
  • Default collection for sales representatives

FavoriteList.slug ● String! non-null scalar

A URL-friendly slug automatically generated from the list name.

This slug can be used for creating user-friendly URLs and is automatically updated when the list name changes.

Characteristics:

  • Automatically generated from the name field
  • Contains only lowercase letters, numbers, and hyphens
  • Unique within the owner's scope
  • Updated automatically when name changes
  • Cannot be set manually

Use cases:

  • SEO-friendly URLs
  • Human-readable identifiers
  • URL routing and navigation
  • API endpoint references

FavoriteList.createdAt ● DateTime! non-null scalar

The timestamp when this favorite list was first created.

This value is automatically set when the list is created and never changes.

Characteristics:

  • Automatically set on creation
  • Cannot be modified after creation
  • ISO 8601 format in responses
  • Used for audit trails and compliance

Use cases:

  • Audit logging and compliance
  • Chronological sorting
  • Date range filtering in searches
  • Analytics and reporting
  • Data retention policies

FavoriteList.updatedAt ● DateTime! non-null scalar

The timestamp when this favorite list was last modified.

This value is automatically updated whenever the list name, content, or properties are changed.

Characteristics:

  • Automatically updated on any modification
  • ISO 8601 format in responses
  • Tracks all types of changes (name, items, settings)
  • Used for change tracking and synchronization

Use cases:

  • Change detection and synchronization
  • Conflict resolution in concurrent updates
  • Cache invalidation strategies
  • Analytics and usage tracking
  • Data freshness validation

Triggers for updates:

  • Name changes
  • Item additions or removals
  • Default status changes
  • Any field modifications

FavoriteList.products ● ProductsResponse object

Complete product information for items in the favorite list.

Detailed product data including specifications, pricing, availability, and all attributes for products saved in this favorite list.

FavoriteList.products.input ● ProductSearchInput input

FavoriteList.clusters ● ProductsResponse object

Complete cluster information for items in the favorite list.

Detailed cluster data including configuration options, products, and all attributes for clusters saved in this favorite list.

FavoriteList.clusters.input ● ProductSearchInput input

FavoriteList.company ● Company object

FavoriteList.contact ● Contact object

FavoriteList.customer ● Customer object

Returned By

favoriteList query ● favoriteListAddItems mutation ● favoriteListClearItems mutation ● favoriteListCreate mutation ● favoriteListRemoveItems mutation ● favoriteListUpdate mutation

Member Of

FavoriteListsResponse object