saleor-dashboard/src/discounts/mutations.ts
Jonatan Witoszek 90807bb0cf
Update unassignProductAttributeMutation to use new array parameter types (#1957)
* Update unassignProductAttributeMutation to use new array parameter types

* Replace [Collection]! with [Collection!]! in queries to match API changes

* Fix failing test on ProductVariantPage
2022-03-31 14:45:48 +02:00

214 lines
3.7 KiB
TypeScript

import { gql } from "@apollo/client";
export const saleUpdate = gql`
mutation SaleUpdate(
$input: SaleInput!
$id: ID!
$channelInput: SaleChannelListingInput!
) {
saleUpdate(id: $id, input: $input) {
errors {
...DiscountError
}
}
saleChannelListingUpdate(id: $id, input: $channelInput) {
errors {
...DiscountError
}
sale {
...Sale
}
}
}
`;
export const saleCataloguesAdd = gql`
mutation SaleCataloguesAdd(
$input: CatalogueInput!
$id: ID!
$after: String
$before: String
$first: Int
$last: Int
) {
saleCataloguesAdd(id: $id, input: $input) {
errors {
...DiscountError
}
sale {
...SaleDetails
}
}
}
`;
export const saleCataloguesRemove = gql`
mutation SaleCataloguesRemove(
$input: CatalogueInput!
$id: ID!
$after: String
$before: String
$first: Int
$last: Int
) {
saleCataloguesRemove(id: $id, input: $input) {
errors {
...DiscountError
}
sale {
...SaleDetails
}
}
}
`;
export const saleCreate = gql`
mutation SaleCreate($input: SaleInput!) {
saleCreate(input: $input) {
errors {
...DiscountError
}
sale {
...Sale
}
}
}
`;
export const saleDelete = gql`
mutation SaleDelete($id: ID!) {
saleDelete(id: $id) {
errors {
...DiscountError
}
}
}
`;
export const saleBulkDelete = gql`
mutation SaleBulkDelete($ids: [ID!]!) {
saleBulkDelete(ids: $ids) {
errors {
...SaleBulkDeleteError
}
}
}
`;
export const saleChannelListingUpdate = gql`
mutation SaleChannelListingUpdate(
$id: ID!
$input: SaleChannelListingInput!
) {
saleChannelListingUpdate(id: $id, input: $input) {
errors {
...DiscountError
}
sale {
...Sale
}
}
}
`;
export const voucherChannelListingUpdate = gql`
mutation VoucherChannelListingUpdate(
$id: ID!
$input: VoucherChannelListingInput!
) {
voucherChannelListingUpdate(id: $id, input: $input) {
errors {
...DiscountError
}
voucher {
...Voucher
}
}
}
`;
export const voucherUpdate = gql`
mutation VoucherUpdate($input: VoucherInput!, $id: ID!) {
voucherUpdate(id: $id, input: $input) {
errors {
...DiscountError
}
voucher {
...Voucher
}
}
}
`;
export const voucherCataloguesAdd = gql`
mutation VoucherCataloguesAdd(
$input: CatalogueInput!
$id: ID!
$after: String
$before: String
$first: Int
$last: Int
) {
voucherCataloguesAdd(id: $id, input: $input) {
errors {
...DiscountError
}
voucher {
...VoucherDetails
}
}
}
`;
export const voucherCataloguesRemove = gql`
mutation VoucherCataloguesRemove(
$input: CatalogueInput!
$id: ID!
$after: String
$before: String
$first: Int
$last: Int
) {
voucherCataloguesRemove(id: $id, input: $input) {
errors {
...DiscountError
}
voucher {
...VoucherDetails
}
}
}
`;
export const voucherCreate = gql`
mutation VoucherCreate($input: VoucherInput!) {
voucherCreate(input: $input) {
errors {
...DiscountError
}
voucher {
...Voucher
}
}
}
`;
export const voucherDelete = gql`
mutation VoucherDelete($id: ID!) {
voucherDelete(id: $id) {
errors {
...DiscountError
}
}
}
`;
export const voucherBulkDelete = gql`
mutation VoucherBulkDelete($ids: [ID!]!) {
voucherBulkDelete(ids: $ids) {
errors {
...VoucherBulkDeleteError
}
}
}
`;