What's your biggest current challenge? Have your say in Community Polls along the right column.

Why when i try to make a giftCardDeactivate request with Graphql , tell me that doesn't exists

Why when i try to make a giftCardDeactivate request with Graphql , tell me that doesn't exists

Leobar00
Shopify Partner
12 0 3

Why when i try to make a giftCardDeactivate request with Graphql , tell me that doesn't exists ? 

This is the error returned : Field \'giftCardDeactivate\' doesn\'t exist on type \'Mutation\ 

And below the code :

 

 

$mutation = <<<GRAPHQL
        mutation giftCardDeactivate(\$id: ID!) {
            giftCardDeactivate(id: \$id) {
              giftCard {
                id
                deactivatedAt
              }
              userErrors {
                message
                field
                code
              }
            }
          }
        GRAPHQL;

        $variables = ['id' => $giftCardId];
        $response = $this->graphClient->query(['query' => $mutation,'variables' => $variables]);
        $data = $response->getDecodedBody();
        var_dump($data);

 

 

 

 

Replies 0 (0)