diff --git a/src/ShopifyApp/Console/WebhookJobMakeCommand.php b/src/ShopifyApp/Console/WebhookJobMakeCommand.php index 6d43fa5e..4fbe35c7 100644 --- a/src/ShopifyApp/Console/WebhookJobMakeCommand.php +++ b/src/ShopifyApp/Console/WebhookJobMakeCommand.php @@ -54,9 +54,7 @@ protected function getArguments(): array public function handle() { $result = parent::handle(); - $topic = Util::getGraphQLWebhookTopic($this->argument('topic')); - $type = $this->getUrlFromName($this->argument('name')); $address = route(Util::getShopifyConfig('route_names.webhook'), $type); diff --git a/src/ShopifyApp/Services/ApiHelper.php b/src/ShopifyApp/Services/ApiHelper.php index b6334b77..85e67aa4 100644 --- a/src/ShopifyApp/Services/ApiHelper.php +++ b/src/ShopifyApp/Services/ApiHelper.php @@ -384,10 +384,9 @@ public function createWebhook(array $payload): ResponseAccess } '; - // change REST-format topics ("resource/event") - // to GraphQL-format topics ("RESOURCE_EVENT") for pre-v17 compatibility + // Change REST-format topics ("resource/event") + // to GraphQL-format topics ("RESOURCE_EVENT"), for pre-v17 compatibility $topic = Util::getGraphQLWebhookTopic($payload['topic']); - $variables = [ 'topic' => $topic, 'webhookSubscription' => [ diff --git a/tests/UtilTest.php b/tests/UtilTest.php index 9196279a..57167cbf 100644 --- a/tests/UtilTest.php +++ b/tests/UtilTest.php @@ -87,9 +87,9 @@ public function testGraphQLWebhookTopic(): void { // REST-format topics are changed to the GraphQL format $topics = [ - 'app/uninstalled' => 'APP_UNINSTALLED', + 'app/uninstalled' => 'APP_UNINSTALLED', 'orders/partially_fulfilled' => 'ORDERS_PARTIALLY_FULFILLED', - 'order_transactions/create' => 'ORDER_TRANSACTIONS_CREATE', + 'order_transactions/create' => 'ORDER_TRANSACTIONS_CREATE', ]; foreach ($topics as $restTopic => $graphQLTopic) {