Skip to content

Commit

Permalink
We only need one kind of authenticator
Browse files Browse the repository at this point in the history
Reasoning: this package won't do the authentication process therefore any other information (client id, etc) is unnecessary.
  • Loading branch information
xHeaven committed Jul 9, 2024
1 parent b6c52bc commit 6986ea8
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 38 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ php artisan vendor:publish --tag="laravel-shopify-graphql-config"

```php
use Luminarix\Shopify\GraphQLClient\Facades\GraphQLClient;
use Luminarix\Shopify\GraphQLClient\Authenticators\PublicApp;
use Luminarix\Shopify\GraphQLClient\Authenticators\PrivateApp;
use Luminarix\Shopify\GraphQLClient\Authenticators\ShopifyApp;

$graphql = GraphQLClient::factory();

$authenticator = new PublicApp($shopDomain, $accessToken, $clientId, $clientSecret, $apiVersion);
// OR
$authenticator = new PrivateApp($shopDomain, $accessToken, $apiKey, $apiSecretKey, $apiVersion);
$authenticator = new ShopifyApp($shopDomain, $accessToken, $apiVersion);

$client = $graphql->create($authenticator)

Expand Down
5 changes: 0 additions & 5 deletions config/shopify-graphql.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@

return [
'api_version' => env('SHOPIFY_API_VERSION', '2024-04'),
'client_id' => env('SHOPIFY_CLIENT_ID'),
'client_secret' => env('SHOPIFY_CLIENT_SECRET'),
'scopes' => [
'read_products',
],
];
1 change: 0 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ parameters:
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false
24 changes: 0 additions & 24 deletions src/Authenticators/PublicApp.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
use Luminarix\Shopify\GraphQLClient\Authenticators\Abstracts\AbstractAppAuthenticator;
use SensitiveParameter;

class PrivateApp extends AbstractAppAuthenticator
class ShopifyApp extends AbstractAppAuthenticator
{
public function __construct(
string $shopDomain,
#[SensitiveParameter] public string $accessToken,
public string $apiKey,
#[SensitiveParameter] public string $apiSecretKey,
?string $apiVersion = null,
) {
$this->setShopDomain($shopDomain);
Expand Down

0 comments on commit 6986ea8

Please sign in to comment.