Answer the question
In order to leave comments, you need to log in
Nested upsert in grqphql query?
There is a request with the following parameters
updateSaleChannelAttribute(
input: {
rules: { connect: $rules }
}
)
{
...item
values: {
upsert: item.values
}
}
const UPDATE_CHANNEL_ATTRIBUTE = gql`
mutation UpdateChannelAttribute(
$id: ID!
$code: String!
$name: String!
$value: String
$saleChannelCategories: [ID!]
$rules: [UpdateSaleChannelAttributeRuleInput!]
$childs: [SaleChannelAttributeSaleChannelAttribute!]
$delimeter: String
$attributes: [ID!]
) {
updateSaleChannelAttribute(
input: {
id: $id
code: $code
name: $name
value: $value
saleChannelCategories: { sync: $saleChannelCategories }
rules: { upsert: $rules }
childs: { sync: $childs }
delimeter: $delimeter
attributes: { sync: $attributes }
}
) {
id
name
code
value
delimeter
rules {
id
rule
json_mask
values {
id
key
value
type
}
}
childs {
id
}
attributes {
id
name
code
}
saleChannelCategories {
id
name
parent {
id
name
parent {
id
name
}
}
saleChannel {
id
name
}
}
}
}
`;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question