saleor-dashboard/src/discounts/queries.ts
Dawid 1002a11f41
Fix pagination errors on voucher and sale pages (#2317)
* Fix pagination errors on voucher and sale pages

* Update messages on voucher and sale pages

* Update changelog with pagination fix

* Update test snapshots of voucher and sale pages

* Update types of voucher and sale pages
2022-10-04 16:45:24 +02:00

98 lines
1.6 KiB
TypeScript

import { gql } from "@apollo/client";
export const saleList = gql`
query SaleList(
$after: String
$before: String
$first: Int
$last: Int
$filter: SaleFilterInput
$sort: SaleSortingInput
$channel: String
) {
sales(
after: $after
before: $before
first: $first
last: $last
filter: $filter
sortBy: $sort
channel: $channel
) {
edges {
node {
...Sale
}
}
pageInfo {
...PageInfo
}
}
}
`;
export const voucherList = gql`
query VoucherList(
$after: String
$before: String
$first: Int
$last: Int
$filter: VoucherFilterInput
$sort: VoucherSortingInput
$channel: String
) {
vouchers(
after: $after
before: $before
first: $first
last: $last
filter: $filter
sortBy: $sort
channel: $channel
) {
edges {
node {
...Voucher
}
}
pageInfo {
...PageInfo
}
}
}
`;
export const saleDetails = gql`
query SaleDetails(
$id: ID!
$after: String
$before: String
$first: Int
$last: Int
$includeVariants: Boolean!
$includeProducts: Boolean!
$includeCollections: Boolean!
$includeCategories: Boolean!
) {
sale(id: $id) {
...SaleDetails
}
}
`;
export const voucherDetails = gql`
query VoucherDetails(
$id: ID!
$after: String
$before: String
$first: Int
$last: Int
$includeProducts: Boolean!
$includeCollections: Boolean!
$includeCategories: Boolean!
) {
voucher(id: $id) {
...VoucherDetails
}
}
`;