2020-07-07 10:14:12 +00:00
|
|
|
import gql from "graphql-tag";
|
|
|
|
|
|
|
|
import { fragmentAddress } from "./address";
|
|
|
|
|
|
|
|
export const fragmentOrderEvent = gql`
|
|
|
|
fragment OrderEventFragment on OrderEvent {
|
|
|
|
id
|
|
|
|
amount
|
|
|
|
date
|
|
|
|
email
|
|
|
|
emailType
|
2020-07-15 17:19:50 +00:00
|
|
|
invoiceNumber
|
2020-07-07 10:14:12 +00:00
|
|
|
message
|
|
|
|
quantity
|
|
|
|
type
|
|
|
|
user {
|
|
|
|
id
|
|
|
|
email
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const fragmentOrderLine = gql`
|
|
|
|
fragment OrderLineFragment on OrderLine {
|
|
|
|
id
|
|
|
|
isShippingRequired
|
|
|
|
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
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-07-07 10:14:12 +00:00
|
|
|
export const fragmentOrderDetails = gql`
|
|
|
|
${fragmentAddress}
|
|
|
|
${fragmentOrderEvent}
|
|
|
|
${fragmentOrderLine}
|
|
|
|
${fulfillmentFragment}
|
2020-07-03 10:05:44 +00:00
|
|
|
${invoiceFragment}
|
2020-07-07 10:14:12 +00:00
|
|
|
fragment OrderDetailsFragment on Order {
|
|
|
|
id
|
|
|
|
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
|
|
|
|
}
|
2020-07-07 10:14:12 +00:00
|
|
|
}
|
|
|
|
`;
|