saleor-dashboard/cypress/support/api/requests/Plugins.js

38 lines
779 B
JavaScript
Raw Normal View History

export function updatePlugin(id, name, value, channel) {
const channelLine = channel ? `channelId: "${channel}"` : "";
const mutation = `mutation{
pluginUpdate(
id:"${id}",
${channelLine},
input:{
configuration:[{
name:"${name}",
value:"${value}"
}]
}){
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:{
active:${active}
2022-10-27 09:40:33 +00:00
}){
errors{
field
message
}
}
}`;
return cy.sendRequestWithQuery(mutation);
}