Campaigns
The campaign node
| Method | Type | Description |
|---|---|---|
| pk | Int |
|
| id | ID! |
|
| merchant | UserNode |
|
| stores | StoreNodeConnection! |
|
| storeGroups | StoreGroupNodeConnection! |
|
| name | String! |
|
| start | DateTime! |
|
| end | DateTime! |
|
| status | CampaignStatus! |
|
| images | CampaignImageNodeConnection! |
|
| offers | OfferNodeConnection! |
|
| loyaltyCards | LoyaltyCardNodeConnection! |
|
| activities | ActivityNodeConnection |
|
| extraInfo | JSONString |
|
| createdAt | DateTime! |
|
| updatedAt | DateTime! |
Create a campaign
mutation (
$name: String!
$start: Date!
$end: Date!
$status: String
$stores: [ID]
$storeGroups: [ID]
$images: [ImageInput]!
){
createCampaign(
input: {
name: $name
start: $start
end: $end
status: $status
stores: $stores
storeGroups: $storeGroups
images: $images
}
) {
success
errors
campaign {
pk
id
}
}
}
Update a campaign
mutation (
$id: ID!
$name: String
$start: Date
$end: Date
$status: String
$stores: [ID]
$storeGroups: [ID]
$images: [ImageInput]
){
updateCampaign(
input: {
id: $id
name: $name
start: $start
end: $end
status: $status
stores: $stores
storeGroups: $storeGroups
images: $images
}
) {
success
errors
campaign {
pk
id
}
}
}