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.
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.07Esign\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
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']);
}
}composer test