mcarrowsmith-packages / shopify-graphql-client
v1.1
2022-10-21 16:40 UTC
Requires
- php: ^7.4 || ^8.0.0
- ext-json: *
- guzzlehttp/guzzle: ^7.5
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.11
- phpspec/phpspec: ^7.2
- phpstan/phpstan: ^1.8
- vlucas/phpdotenv: ^5.4
README
Shopify GraphQL Client
PHP Client to send GraphQL requests to Shopify Admin API.
Installation
You can install the package via composer:
composer require mcarrowsmith-packages/shopify-graphql-client
Usage
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.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.