Module: native/Shopify
Type aliases
Cart
Ƭ Cart: Object
Type declaration
| Name | Type |
|---|---|
checkout | null | Promise<Checkout> |
count | number |
items | Map<string, number> |
loading | boolean |
result | Result<Checkout> |
trigger | number |
localCount | () => void |
refresh | () => void |
setCount | (count: number) => void |
setLoading | () => void |
setResult | (res: Result<Checkout>) => void |
Variables
OrderDetailFragment
• OrderDetailFragment: DocumentNode
useGlobalCheckout
• useGlobalCheckout: UseBoundStore<Cart, StoreApi<Cart>>
Functions
checkoutCreate
▸ checkoutCreate(client, shopify): Promise<Checkout>
Parameters
| Name | Type |
|---|---|
client | any |
shopify | any |
Returns
Promise<Checkout>
checkoutLineItemsAdd
▸ checkoutLineItemsAdd(client, shopify, id, lineItems): Promise<any>
Parameters
| Name | Type |
|---|---|
client | any |
shopify | any |
id | any |
lineItems | any |
Returns
Promise<any>
checkoutLineItemsUpdate
▸ checkoutLineItemsUpdate(shopify, id, lineItems): Promise<any>
Parameters
| Name | Type |
|---|---|
shopify | any |
id | any |
lineItems | any |
Returns
Promise<any>
insertCheckout
▸ insertCheckout(client, doc): any
Parameters
| Name | Type |
|---|---|
client | any |
doc | Checkout |
Returns
any
query
▸ query(shopify, query, variables?, options?): Promise<any>
Parameters
| Name | Type | Default value |
|---|---|---|
shopify | Object | undefined |
shopify.domain | string | undefined |
shopify.storefrontAccessToken | string | undefined |
query | any | undefined |
variables | Object | {} |
options | null | null |
Returns
Promise<any>
updateCheckout
▸ updateCheckout(client, id, doc): any
Parameters
| Name | Type |
|---|---|
client | any |
id | string |
doc | Checkout |
Returns
any
useCheckout
▸ useCheckout(): { addItem: (variantId: string, quantity: number) => Promise<void> ; count: number ; data: null ; errors: Error[] ; id: string ; items: Map<string, number> ; loading: boolean ; removeItem: (variantId: string, quantity: number) => Promise<void> ; updateItem: (variantId: string, quantity: number) => Promise<void> ; webUrl: string } | { addItem: (variantId: string, quantity: number) => Promise<void> ; count: number ; data: null | Checkout ; errors: null ; id: string ; items: Map<string, number> ; loading: boolean ; removeItem: (variantId: string, quantity: number) => Promise<void> ; updateItem: (variantId: string, quantity: number) => Promise<void> ; webUrl: string }
Returns
{ addItem: (variantId: string, quantity: number) => Promise<void> ; count: number ; data: null ; errors: Error[] ; id: string ; items: Map<string, number> ; loading: boolean ; removeItem: (variantId: string, quantity: number) => Promise<void> ; updateItem: (variantId: string, quantity: number) => Promise<void> ; webUrl: string } | { addItem: (variantId: string, quantity: number) => Promise<void> ; count: number ; data: null | Checkout ; errors: null ; id: string ; items: Map<string, number> ; loading: boolean ; removeItem: (variantId: string, quantity: number) => Promise<void> ; updateItem: (variantId: string, quantity: number) => Promise<void> ; webUrl: string }
useCheckouts
▸ useCheckouts(): { data: null ; errors: Error[] ; loading: boolean ; refresh: DispatchWithoutAction } | { data: null | Checkout[] ; errors: null ; loading: boolean ; refresh: DispatchWithoutAction }
Returns
{ data: null ; errors: Error[] ; loading: boolean ; refresh: DispatchWithoutAction } | { data: null | Checkout[] ; errors: null ; loading: boolean ; refresh: DispatchWithoutAction }
useOrder
▸ useOrder(id): { data: null ; errors: Error[] ; loading: boolean ; refresh: DispatchWithoutAction } | { data: null | Order[] ; errors: null ; loading: boolean ; refresh: DispatchWithoutAction }
Parameters
| Name | Type |
|---|---|
id | string |
Returns
{ data: null ; errors: Error[] ; loading: boolean ; refresh: DispatchWithoutAction } | { data: null | Order[] ; errors: null ; loading: boolean ; refresh: DispatchWithoutAction }
useProduct
▸ useProduct(handle?): Result<ProductByHandle>
Parameters
| Name | Type | Default value |
|---|---|---|
handle | string | '' |
Returns
useProducts
▸ useProducts(filter): { data: null ; errors: Error[] ; loading: boolean ; refresh: DispatchWithoutAction } | { data: null | Products ; errors: null ; loading: boolean ; refresh: DispatchWithoutAction }
Parameters
| Name | Type |
|---|---|
filter | ShopifySearchFilter |
Returns
{ data: null ; errors: Error[] ; loading: boolean ; refresh: DispatchWithoutAction } | { data: null | Products ; errors: null ; loading: boolean ; refresh: DispatchWithoutAction }