saleor-dashboard/src/fragments/orders.ts

173 lines
2.5 KiB
TypeScript
Raw Normal View History

import gql from "graphql-tag";
import { fragmentAddress } from "./address";
2020-09-01 16:22:54 +00:00
import { metadataFragment } from "./metadata";
export const fragmentOrderEvent = gql`
fragment OrderEventFragment on OrderEvent {
id
amount
date
email
emailType
invoiceNumber
message
quantity
type
user {
id
email
}
}
`;
export const fragmentOrderLine = gql`
fragment OrderLineFragment on OrderLine {
id
isShippingRequired
variant {
product {
isAvailableForPurchase
isPublished
}
quantityAvailable
}
productName
productSku
quantity
quantityFulfilled
unitPrice {
gross {
amount
currency
}
net {
amount
currency
}
}
thumbnail {
url
}
}
`;
export const fulfillmentFragment = gql`
${fragmentOrderLine}
fragment FulfillmentFragment on Fulfillment {
id
lines {
id
quantity
orderLine {
...OrderLineFragment
}
}
fulfillmentOrder
status
trackingNumber
warehouse {
id
name
}
}
`;
2020-07-03 10:05:44 +00:00
export const invoiceFragment = gql`
2020-06-22 16:34:59 +00:00
fragment InvoiceFragment on Invoice {
id
number
createdAt
url
2020-06-23 12:27:44 +00:00
status
2020-06-22 16:34:59 +00:00
}
`;
export const fragmentOrderDetails = gql`
${fragmentAddress}
${fragmentOrderEvent}
${fragmentOrderLine}
${fulfillmentFragment}
2020-07-03 10:05:44 +00:00
${invoiceFragment}
2020-09-01 16:22:54 +00:00
${metadataFragment}
fragment OrderDetailsFragment on Order {
id
2020-09-01 16:22:54 +00:00
...MetadataFragment
billingAddress {
...AddressFragment
}
canFinalize
created
customerNote
events {
...OrderEventFragment
}
fulfillments {
...FulfillmentFragment
}
lines {
...OrderLineFragment
}
number
paymentStatus
shippingAddress {
...AddressFragment
}
shippingMethod {
id
}
shippingMethodName
shippingPrice {
gross {
amount
currency
}
}
status
subtotal {
gross {
amount
currency
}
}
total {
gross {
amount
currency
}
tax {
amount
currency
}
}
actions
totalAuthorized {
amount
currency
}
totalCaptured {
amount
currency
}
user {
id
email
}
userEmail
availableShippingMethods {
id
name
price {
amount
currency
}
}
discount {
amount
currency
}
2020-06-22 16:34:59 +00:00
invoices {
...InvoiceFragment
}
}
`;