Skip to content

Commit

Permalink
Remove passable ShopifyConnector, not planning on generalizing it
Browse files Browse the repository at this point in the history
  • Loading branch information
xHeaven committed Dec 16, 2024
1 parent 967d60e commit 8dd97c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/GraphQLClientCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@

use Luminarix\Shopify\GraphQLClient\Authenticators\Abstracts\AbstractAppAuthenticator;
use Luminarix\Shopify\GraphQLClient\Contracts\RateLimitable;
use Luminarix\Shopify\GraphQLClient\Integrations\ShopifyConnector;

class GraphQLClientCreate
{
public function create(
AbstractAppAuthenticator $appAuthenticator,
?ShopifyConnector $connector = null,
?RateLimitable $rateLimitService = null,
): GraphQLClientMethods {
return new GraphQLClientMethods($appAuthenticator, $connector, $rateLimitService);
return new GraphQLClientMethods($appAuthenticator, $rateLimitService);
}
}
5 changes: 3 additions & 2 deletions src/GraphQLClientMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class GraphQLClientMethods
{
use Macroable;

private ?ShopifyConnector $connector = null;

private float|int|null $requestedQueryCost = null;

private float|int|null $actualQueryCost = null;
Expand All @@ -35,10 +37,9 @@ class GraphQLClientMethods

public function __construct(
private readonly AbstractAppAuthenticator $appAuthenticator,
private ?ShopifyConnector $connector = null,
private ?RateLimitable $rateLimitService = null,
) {
$this->connector ??= new ShopifyConnector($this->appAuthenticator);
$this->connector = new ShopifyConnector($this->appAuthenticator);
$this->rateLimitService ??= new RedisRateLimitService($this->appAuthenticator->getShopDomain());
}

Expand Down

0 comments on commit 8dd97c6

Please sign in to comment.