PHP Client to send GraphQL requests to Shopify Admin API.
You can install the package via composer:
composer require mcarrowsmith-packages/shopify-graphql-client
Make sure you have correct credentials to access the Shopify Store via Partner Account or Custom App.
use \McArrowsmithPackages\ShopifyGraphQLClient\ClientFactory;
$query = <<<'QUERY'
query {
shop {
name
}
}
QUERY;
$factory = ClientFactory::make('example.myshopify.com', '<API-TOKEN>', '2022-07');
try {
$factory->request($query);
} catch (\Throwable $t) {
echo $t->getMessage() . PHP_EOL;
}
See scripts for full usage and examples.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.