luminarix / laravel-shopify-graphql
GraphQL client for Shopify.
Fund package maintenance!
luminarix
Installs: 1 059
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.3
- illuminate/contracts: ^11.0
- saloonphp/saloon: ^3.8
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- jetbrains/phpstorm-attributes: ^1.1
- larastan/larastan: ^2.9
- laravel/pint: ^1.15
- nunomaduro/collision: ^8.1.1
- orchestra/testbench: ^9.0.0
- pestphp/pest: ^3.5.0
- pestphp/pest-plugin-arch: ^v3.0.0
- pestphp/pest-plugin-laravel: ^v3.0.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
README
This is a work in progress package to provide a GraphQL client for Shopify.
Installation
You can install the package via composer:
composer require luminarix/laravel-shopify-graphql
You can publish the config file with:
php artisan vendor:publish --tag="laravel-shopify-graphql-config"
Usage
use Luminarix\Shopify\GraphQLClient\Facades\GraphQLClient; use Luminarix\Shopify\GraphQLClient\Authenticators\ShopifyApp; $graphql = GraphQLClient::factory(); $authenticator = new ShopifyApp($shopDomain, $accessToken, $apiVersion); $client = $graphql->create($authenticator) // Query $query = 'query { node(id: "gid://shopify/Order/148977776") { id ... on Order { name } } }'; $response = $client->query($query); // Mutation $mutation = 'mutation orderMarkAsPaid($input: OrderMarkAsPaidInput!) { orderMarkAsPaid(input: $input) { order { # Order fields } userErrors { field message } } }'; $variables = [ 'input' => [ 'id' => 'gid://shopify/<objectName>/10079785100', ], ]; $response = $client->mutation($mutation, $variables);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.