Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Shopify

## Unreleased

- `shopifyId` and `shopifyGid` fields are now available when query product variants via GraphQL. ([#211](https://github.com/craftcms/shopify/issues/211))

## 7.1.0 - 2026-04-08

- Added support for querying for products via GraphQL. ([#49](https://github.com/craftcms/shopify/discussions/49), [#203](https://github.com/craftcms/shopify/issues/203), [#206](https://github.com/craftcms/shopify/pull/206))
Expand Down
12 changes: 12 additions & 0 deletions src/gql/types/Variant.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,19 @@ public static function getFieldDefinitions(): array
'id' => [
'name' => 'id',
'type' => Type::string(),
'description' => 'ID of the variant.',
],
'shopifyId' => [
'name' => 'shopifyId',
'type' => Type::string(),
'description' => 'Shopify ID of the variant.',
'resolve' => fn(VariantElement $source) => str_replace('gid://shopify/ProductVariant/', '', $source->shopifyId),
],
'shopifyGid' => [
'name' => 'shopifyGid',
'type' => Type::string(),
'description' => 'Shopify GID of the variant.',
'resolve' => fn(VariantElement $source) => $source->shopifyId,
],
'title' => [
'name' => 'title',
Expand Down
Loading