mcarrowsmith-packages/shopify-graphql-client

v1.1 2022-10-21 16:40 UTC

This package is auto-updated.

Last update: 2024-04-21 19:49:12 UTC


README

68747470733a2f2f6d636172726f77736d6974682e636f2e756b2f6173736574732f696d616765732f6d636172726f77736d6974682d636f6e73756c74696e672d736f6369616c2d636172642e706e67

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.