
* Update schema, remove transaction specific files * Merge `.transaction` queries and mutations into regular files * Merge OrderDetails fragments * Remove usage of `.transaction` graphl types * Update fixtures * Remove usage of useFlag, remove duplicated queries & mutations * Fix displayed event type for INFO * Remove type alias from order/types.ts, remove type casting * Fix failing tests * Add preview label and better description in Channel settings * Update button in GrantRefund page * Fix missing data-test-id * Extract messages * Visual fixes * Revert changes to generated files * Revert changes to generated files * Fix psp reference hover * Fix colors on manu refunds screen * Revert "Fix colors on manu refunds screen" This reverts commit 02302930ab502a4fdc3c71558532a2d74f2e32c9. --------- Co-authored-by: andrzejewsky <vox3r69@gmail.com> Co-authored-by: Michal Miszczyszyn <michal@mmiszy.pl>
266 lines
4.6 KiB
TypeScript
266 lines
4.6 KiB
TypeScript
import { gql } from "@apollo/client";
|
|
|
|
export const orderListQuery = gql`
|
|
query OrderList(
|
|
$first: Int
|
|
$after: String
|
|
$last: Int
|
|
$before: String
|
|
$filter: OrderFilterInput
|
|
$sort: OrderSortingInput
|
|
) {
|
|
orders(
|
|
before: $before
|
|
after: $after
|
|
first: $first
|
|
last: $last
|
|
filter: $filter
|
|
sortBy: $sort
|
|
) {
|
|
edges {
|
|
node {
|
|
__typename
|
|
billingAddress {
|
|
...Address
|
|
}
|
|
created
|
|
id
|
|
number
|
|
paymentStatus
|
|
status
|
|
total {
|
|
__typename
|
|
gross {
|
|
__typename
|
|
amount
|
|
currency
|
|
}
|
|
}
|
|
userEmail
|
|
}
|
|
}
|
|
pageInfo {
|
|
hasPreviousPage
|
|
hasNextPage
|
|
startCursor
|
|
endCursor
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
export const orderDraftListQuery = gql`
|
|
query OrderDraftList(
|
|
$first: Int
|
|
$after: String
|
|
$last: Int
|
|
$before: String
|
|
$filter: OrderDraftFilterInput
|
|
$sort: OrderSortingInput
|
|
) {
|
|
draftOrders(
|
|
before: $before
|
|
after: $after
|
|
first: $first
|
|
last: $last
|
|
filter: $filter
|
|
sortBy: $sort
|
|
) {
|
|
edges {
|
|
node {
|
|
__typename
|
|
billingAddress {
|
|
...Address
|
|
}
|
|
created
|
|
id
|
|
number
|
|
paymentStatus
|
|
status
|
|
total {
|
|
__typename
|
|
gross {
|
|
__typename
|
|
amount
|
|
currency
|
|
}
|
|
}
|
|
userEmail
|
|
}
|
|
}
|
|
pageInfo {
|
|
hasPreviousPage
|
|
hasNextPage
|
|
startCursor
|
|
endCursor
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const orderDetailsQuery = gql`
|
|
query OrderDetails($id: ID!) {
|
|
order(id: $id) {
|
|
...OrderDetails
|
|
}
|
|
shop {
|
|
countries {
|
|
code
|
|
country
|
|
}
|
|
defaultWeightUnit
|
|
fulfillmentAllowUnpaid
|
|
fulfillmentAutoApprove
|
|
availablePaymentGateways {
|
|
...PaymentGateway
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const orderDetailsGrantedRefund = gql`
|
|
query OrderDetailsGrantRefund($id: ID!) {
|
|
order(id: $id) {
|
|
...OrderDetailsGrantRefund
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const orderDetailsGrantedRefundEdit = gql`
|
|
query OrderDetailsGrantRefundEdit($id: ID!) {
|
|
order(id: $id) {
|
|
...OrderDetailsGrantRefund
|
|
grantedRefunds {
|
|
id
|
|
reason
|
|
amount {
|
|
...Money
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const orderFulfillData = gql`
|
|
query OrderFulfillData($orderId: ID!) {
|
|
order(id: $orderId) {
|
|
id
|
|
isPaid
|
|
deliveryMethod {
|
|
__typename
|
|
... on ShippingMethod {
|
|
id
|
|
}
|
|
... on Warehouse {
|
|
id
|
|
clickAndCollectOption
|
|
}
|
|
}
|
|
lines {
|
|
...OrderFulfillLine
|
|
}
|
|
number
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const orderFulfillSettingsQuery = gql`
|
|
query OrderFulfillSettings {
|
|
shop {
|
|
...ShopOrderSettings
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const orderSettingsQuery = gql`
|
|
query OrderSettings {
|
|
orderSettings {
|
|
...OrderSettings
|
|
}
|
|
shop {
|
|
...ShopOrderSettings
|
|
}
|
|
}
|
|
`;
|
|
export const orderRefundData = gql`
|
|
query OrderRefundData($orderId: ID!) {
|
|
order(id: $orderId) {
|
|
id
|
|
number
|
|
total {
|
|
gross {
|
|
...Money
|
|
}
|
|
}
|
|
totalCaptured {
|
|
...Money
|
|
}
|
|
shippingPrice {
|
|
gross {
|
|
...Money
|
|
}
|
|
}
|
|
lines {
|
|
...RefundOrderLine
|
|
quantityToFulfill
|
|
}
|
|
fulfillments {
|
|
id
|
|
status
|
|
fulfillmentOrder
|
|
lines {
|
|
id
|
|
quantity
|
|
orderLine {
|
|
...RefundOrderLine
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const channelUsabilityData = gql`
|
|
query ChannelUsabilityData($channel: String!) {
|
|
products(channel: $channel) {
|
|
totalCount
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const defaultGraphiQLQuery = /* GraphQL */ `
|
|
query OrderDetailsGraphiQL($id: ID!) {
|
|
order(id: $id) {
|
|
id
|
|
number
|
|
status
|
|
isShippingRequired
|
|
canFinalize
|
|
created
|
|
customerNote
|
|
paymentStatus
|
|
userEmail
|
|
isPaid
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const DevModeQuery = /* GraphQL */ `
|
|
query DevModeRun($filter: OrderFilterInput, $sortBy: OrderSortingInput) {
|
|
orders(first: 10, filter: $filter, sortBy: $sortBy) {
|
|
edges {
|
|
node {
|
|
id
|
|
number
|
|
status
|
|
isShippingRequired
|
|
canFinalize
|
|
created
|
|
customerNote
|
|
paymentStatus
|
|
userEmail
|
|
isPaid
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|