storefront/products

Types

pub type GetProductsOperation {
  GetProductsOperation(
    data: ShopifyProductsOperationData,
    variables: ShopifyProductsOperationVariables,
  )
}

Constructors

pub type Product {
  Product(
    id: String,
    handle: String,
    available_for_sale: Bool,
    title: String,
    description: String,
    description_html: String,
    price_range: utils.PriceRange,
    featured_image: utils.Image,
    seo: utils.Seo,
    tags: List(String),
    updated_at: String,
    variants: List(utils.ProductVariant),
    images: List(utils.Image),
  )
}

Constructors

pub type ProductOption {
  ProductOption(id: String, name: String, values: List(String))
}

Constructors

  • ProductOption(id: String, name: String, values: List(String))
pub type Products {
  Products(products: List(Product))
}

Constructors

  • Products(products: List(Product))
pub type ShopifyCollection {
  ShopifyCollection(
    handle: String,
    title: String,
    description: String,
    seo: utils.Seo,
    updated_at: String,
  )
}

Constructors

  • ShopifyCollection(
      handle: String,
      title: String,
      description: String,
      seo: utils.Seo,
      updated_at: String,
    )

Query operations types and decoders

pub type ShopifyGetProductOperation {
  ShopifyProductOperation(
    data: ShopifyProductOperationData,
    variables: ShopifyProductOperationVariables,
  )
}

Constructors

pub type ShopifyProduct {
  ShopifyProduct(
    id: String,
    handle: String,
    available_for_sale: Bool,
    title: String,
    description: String,
    description_html: String,
    price_range: utils.PriceRange,
    variants: utils.Connection(utils.ProductVariant),
    featured_image: utils.Image,
    images: utils.Connection(utils.Image),
    seo: utils.Seo,
    tags: List(String),
    updated_at: String,
  )
}

Constructors

pub type ShopifyProductOperationData {
  ShopifyProductOperationData(
    product: option.Option(ShopifyProduct),
  )
}

Constructors

pub type ShopifyProductOperationVariables {
  ShopifyProductOperationVariables(handle: String)
}

Constructors

  • ShopifyProductOperationVariables(handle: String)
pub type ShopifyProductRecommendationsOperation {
  ShopifyProductRecommendationsOperation(
    data: ShopifyProductRecommendationsOperationData,
    variables: ShopifyProductRecommendationsOperationVariables,
  )
}

Constructors

pub opaque type ShopifyProductRecommendationsOperationData
pub opaque type ShopifyProductRecommendationsOperationVariables
pub type ShopifyProductsOperationData {
  ShopifyProductsOperationData(
    products: option.Option(utils.Connection(ShopifyProduct)),
  )
}

Constructors

pub type ShopifyProductsOperationVariables {
  ShopifyProductsOperationVariables(
    query: String,
    reverse: Bool,
    sort_key: String,
  )
}

Constructors

  • ShopifyProductsOperationVariables(
      query: String,
      reverse: Bool,
      sort_key: String,
    )

Values

pub const get_product_query: String

Queries

pub const get_product_recommendations_query: String
pub fn get_products_operation_decoder() -> decode.Decoder(
  GetProductsOperation,
)
pub const get_products_query: String
pub fn product_decoder() -> decode.Decoder(Product)
pub fn product_to_json(product: Product) -> json.Json
pub fn products_decoder() -> decode.Decoder(Products)
pub fn reshape_product(
  product: ShopifyProduct,
  filter_hidden_products: Bool,
) -> Product
pub fn reshape_products(
  products: List(ShopifyProduct),
) -> List(Product)
Search Document