Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Minor adjustments to formatting source.
Browse files Browse the repository at this point in the history
  • Loading branch information
gnikyt committed Jul 9, 2021
1 parent 320ea52 commit c239a82
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/ShopifyApp/Console/WebhookJobMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 2 additions & 3 deletions src/ShopifyApp/Services/ApiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
4 changes: 2 additions & 2 deletions tests/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c239a82

Please sign in to comment.