2022-02-21 13:32:38 +00:00
|
|
|
import { gql } from "@apollo/client";
|
2019-08-09 10:17:04 +00:00
|
|
|
|
2022-03-09 08:56:55 +00:00
|
|
|
export const attributeBulkDelete = gql`
|
2019-08-09 10:17:04 +00:00
|
|
|
mutation AttributeBulkDelete($ids: [ID!]!) {
|
|
|
|
attributeBulkDelete(ids: $ids) {
|
2021-04-26 07:49:55 +00:00
|
|
|
errors {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeError
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2022-03-09 08:56:55 +00:00
|
|
|
export const attributeDelete = gql`
|
2019-08-09 10:17:04 +00:00
|
|
|
mutation AttributeDelete($id: ID!) {
|
|
|
|
attributeDelete(id: $id) {
|
2021-04-26 07:49:55 +00:00
|
|
|
errors {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeError
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const attributeUpdateMutation = gql`
|
|
|
|
mutation AttributeUpdate($id: ID!, $input: AttributeUpdateInput!) {
|
|
|
|
attributeUpdate(id: $id, input: $input) {
|
|
|
|
attribute {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeDetails
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
2021-04-26 07:49:55 +00:00
|
|
|
errors {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeError
|
2020-03-24 14:05:26 +00:00
|
|
|
}
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2022-03-09 08:56:55 +00:00
|
|
|
export const attributeValueDelete = gql`
|
2021-05-24 11:01:18 +00:00
|
|
|
mutation AttributeValueDelete(
|
|
|
|
$id: ID!
|
|
|
|
$firstValues: Int
|
|
|
|
$afterValues: String
|
|
|
|
$lastValues: Int
|
|
|
|
$beforeValues: String
|
|
|
|
) {
|
2019-08-09 10:17:04 +00:00
|
|
|
attributeValueDelete(id: $id) {
|
|
|
|
attribute {
|
2021-05-24 11:01:18 +00:00
|
|
|
id
|
2021-06-02 19:11:30 +00:00
|
|
|
choices(
|
2021-05-24 11:01:18 +00:00
|
|
|
first: $firstValues
|
|
|
|
after: $afterValues
|
|
|
|
last: $lastValues
|
|
|
|
before: $beforeValues
|
|
|
|
) {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeValueList
|
2021-05-24 11:01:18 +00:00
|
|
|
}
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
2021-04-26 07:49:55 +00:00
|
|
|
errors {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeError
|
2020-03-24 14:05:26 +00:00
|
|
|
}
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const attributeValueUpdateMutation = gql`
|
2021-05-24 11:01:18 +00:00
|
|
|
mutation AttributeValueUpdate(
|
|
|
|
$id: ID!
|
2021-09-21 13:16:21 +00:00
|
|
|
$input: AttributeValueUpdateInput!
|
2021-05-24 11:01:18 +00:00
|
|
|
$firstValues: Int
|
|
|
|
$afterValues: String
|
|
|
|
$lastValues: Int
|
|
|
|
$beforeValues: String
|
|
|
|
) {
|
2019-08-09 10:17:04 +00:00
|
|
|
attributeValueUpdate(id: $id, input: $input) {
|
|
|
|
attribute {
|
2021-05-24 11:01:18 +00:00
|
|
|
id
|
2021-06-02 19:11:30 +00:00
|
|
|
choices(
|
2021-05-24 11:01:18 +00:00
|
|
|
first: $firstValues
|
|
|
|
after: $afterValues
|
|
|
|
last: $lastValues
|
|
|
|
before: $beforeValues
|
|
|
|
) {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeValueList
|
2021-05-24 11:01:18 +00:00
|
|
|
}
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
2021-04-26 07:49:55 +00:00
|
|
|
errors {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeError
|
2020-03-24 14:05:26 +00:00
|
|
|
}
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const attributeValueCreateMutation = gql`
|
2021-05-24 11:01:18 +00:00
|
|
|
mutation AttributeValueCreate(
|
|
|
|
$id: ID!
|
|
|
|
$input: AttributeValueCreateInput!
|
|
|
|
$firstValues: Int
|
|
|
|
$afterValues: String
|
|
|
|
$lastValues: Int
|
|
|
|
$beforeValues: String
|
|
|
|
) {
|
2019-08-09 10:17:04 +00:00
|
|
|
attributeValueCreate(attribute: $id, input: $input) {
|
|
|
|
attribute {
|
2021-05-24 11:01:18 +00:00
|
|
|
id
|
2021-06-02 19:11:30 +00:00
|
|
|
choices(
|
2021-05-24 11:01:18 +00:00
|
|
|
first: $firstValues
|
|
|
|
after: $afterValues
|
|
|
|
last: $lastValues
|
|
|
|
before: $beforeValues
|
|
|
|
) {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeValueList
|
2021-05-24 11:01:18 +00:00
|
|
|
}
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
2021-04-26 07:49:55 +00:00
|
|
|
errors {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeError
|
2020-03-24 14:05:26 +00:00
|
|
|
}
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const attributeCreateMutation = gql`
|
|
|
|
mutation AttributeCreate($input: AttributeCreateInput!) {
|
|
|
|
attributeCreate(input: $input) {
|
|
|
|
attribute {
|
2021-05-24 11:01:18 +00:00
|
|
|
id
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
2021-04-26 07:49:55 +00:00
|
|
|
errors {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeError
|
2020-03-24 14:05:26 +00:00
|
|
|
}
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2022-03-09 08:56:55 +00:00
|
|
|
export const attributeValueReorderMutation = gql`
|
2021-05-24 11:01:18 +00:00
|
|
|
mutation AttributeValueReorder(
|
|
|
|
$id: ID!
|
|
|
|
$move: ReorderInput!
|
|
|
|
$firstValues: Int
|
|
|
|
$afterValues: String
|
|
|
|
$lastValues: Int
|
|
|
|
$beforeValues: String
|
|
|
|
) {
|
2019-08-09 10:17:04 +00:00
|
|
|
attributeReorderValues(attributeId: $id, moves: [$move]) {
|
|
|
|
attribute {
|
|
|
|
id
|
2021-06-02 19:11:30 +00:00
|
|
|
choices(
|
2021-05-24 11:01:18 +00:00
|
|
|
first: $firstValues
|
|
|
|
after: $afterValues
|
|
|
|
last: $lastValues
|
|
|
|
before: $beforeValues
|
|
|
|
) {
|
|
|
|
pageInfo {
|
2022-03-09 08:56:55 +00:00
|
|
|
...PageInfo
|
2021-05-24 11:01:18 +00:00
|
|
|
}
|
|
|
|
edges {
|
|
|
|
cursor
|
|
|
|
node {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
|
|
|
}
|
2021-04-26 07:49:55 +00:00
|
|
|
errors {
|
2022-03-09 08:56:55 +00:00
|
|
|
...AttributeError
|
2020-03-24 14:05:26 +00:00
|
|
|
}
|
2019-08-09 10:17:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|