2022-11-14 14:56:50 +00:00
|
|
|
export function updatePlugin(id, name, value, channel) {
|
|
|
|
const channelLine = channel ? `channelId: "${channel}"` : "";
|
|
|
|
|
2021-12-05 15:03:29 +00:00
|
|
|
const mutation = `mutation{
|
2022-11-14 14:56:50 +00:00
|
|
|
pluginUpdate(
|
|
|
|
id:"${id}",
|
|
|
|
${channelLine},
|
|
|
|
input:{
|
|
|
|
configuration:[{
|
|
|
|
name:"${name}",
|
2021-12-05 15:03:29 +00:00
|
|
|
value:"${value}"
|
2022-11-14 14:56:50 +00:00
|
|
|
}]
|
2021-12-05 15:03:29 +00:00
|
|
|
}){
|
|
|
|
errors{
|
|
|
|
field
|
|
|
|
message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
return cy.sendRequestWithQuery(mutation);
|
|
|
|
}
|
2022-10-27 09:40:33 +00:00
|
|
|
|
|
|
|
export function activatePlugin({ id, channel, active = true }) {
|
|
|
|
const channelLine = channel ? `channelId: "${channel}"` : "";
|
|
|
|
|
|
|
|
const mutation = `mutation{
|
|
|
|
pluginUpdate(id: "${id}" ${channelLine} input:{
|
2022-12-13 07:04:54 +00:00
|
|
|
active:${active},configuration:
|
2022-10-27 09:40:33 +00:00
|
|
|
}){
|
|
|
|
errors{
|
|
|
|
field
|
|
|
|
message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
return cy.sendRequestWithQuery(mutation);
|
|
|
|
}
|