Hi
I’m using PHPShopify to send GraphQL queries and mutations to my dev shop.
The following code is to deactivate a discount code, using GraphQL and the PHPShopify library
$graphQL = <<<Query
mutation discountCodeDeactivate($id: ID!) {
discountCodeDeactivate(id: $id) {
userErrors {
field
message
}
}
}
Query;
$variables = [
"input" => [
"id" => '12345'
]
];
I keep getting the following error
Uncaught PHPShopify\Exception\ApiException: message - Parse error on ":" (COLON) at [1, 33],
I know it’s because of the variable, but can’t figure out why. I’ve tried swapping $id to $input but it’s the same error.
Any ideas why?