GitHub

DaffMagentoCartItemService

import { DaffMagentoCartItemService } from '@daffodil/cart/driver/magento'

A service for making Magento GraphQL queries for carts.

@Injectable()
class DaffMagentoCartItemService implements DaffCartItemServiceInterface {
  list(cartId: string): Observable<DaffCartItem[]>
  get(
    cartId: string
    itemId: string
  ): Observable<DaffCartItem>
  add(
    cartId: string
    cartItemInput: DaffCartItemInput
  ): Observable<Partial<DaffCart>>
  update(
    cartId: string
    itemId: string
    changes: Partial<DaffCartItem>
  ): Observable<Partial<DaffCart>>
  delete(
    cartId: string
    itemId: string
  ): Observable<Partial<DaffCart>>
}

() Methods

list
Observable<DaffCartItem[]>

List all of the available items of a cart

Parameters
ParametercartId: string
Description
get
Observable<DaffCartItem>

Get a specific cart item of a cart.

Parameters
ParametercartId: string
Description
ParameteritemId: string
Description
add
Observable<Partial<DaffCart>>

Add something to a cart.

Parameters
ParametercartId: string
Description
ParametercartItemInput: DaffCartItemInput
Description
update
Observable<Partial<DaffCart>>

Update an existing item in a cart

Parameters
ParametercartId: string
Description
ParameteritemId: string
Description
Parameterchanges: Partial<DaffCartItem>
Description
delete
Observable<Partial<DaffCart>>

Remove an item from a cart.

Parameters
ParametercartId: string
Description
ParameteritemId: string
Description