esign / shopify-data
Typed DTOs, Inputs and Enums for the Shopify Admin GraphQL API, versioned per Shopify API release
2026-07
2026-07-20 13:15 UTC
Requires
- php: ^8.1
- spatie/laravel-data: ^4.0
Requires (Dev)
- laravel/pint: ^1.13
- orchestra/testbench: ^10.0|^11.0
- phpunit/phpunit: ^11.5.3
README
Typed DTOs, Inputs and Enums for the Shopify Admin GraphQL API, built on spatie/laravel-data.
This package is the optional data-object companion to esign/laravel-shopify. It contains no HTTP or authentication logic — just the typed representations of Shopify Admin API objects, so it can be used with any GraphQL client.
Versioning
Releases track Shopify Admin API versions: tag 2026.07.x matches API
version 2026-07. Patch releases within a tag fix mappings without changing
the targeted API version. Pin the release line that matches the api_version
your app uses:
composer require esign/shopify-data:^2026.07
What's inside
Esign\ShopifyData\DTOs\*— response objects (ProductDto,OrderDto,CustomerDto, …), hydrated via Spatie Data (e.g.ProductDto::from($nodeArray))Esign\ShopifyData\Inputs\*— mutation input objects (ProductInput,CustomerInput, …).toArray()omitsnullproperties so optional fields are excluded from GraphQL variables, whilefalse,0and''are kept.Esign\ShopifyData\Enums\*— backed enums for Shopify enum types (ProductStatus,WeightUnit,MetafieldType, …)Esign\ShopifyData\Support\GlobalID— helpers forgid://shopify/...global IDsEsign\ShopifyData\Casts\NodesToCollectionOfModelsCaster— maps GraphQLedges { node }structures onto Illuminate Collections of DTOs
Usage with esign/laravel-shopify
use Esign\LaravelShopify\GraphQL\Contracts\Query; use Esign\ShopifyData\DTOs\ProductDto; use Shopify\App\Types\GQLResult; class GetProductQuery implements Query { public function __construct(private string $id) {} public function query(): string { return <<<'GRAPHQL' query GetProduct($id: ID!) { product(id: $id) { id title handle status } } GRAPHQL; } public function variables(): array { return ['id' => $this->id]; } public function mapFromResponse(GQLResult $response): ProductDto { return ProductDto::from($response->data['product']); } }
Testing
composer test