Metafield Reference
Returns the resource which is being referred to by a metafield.
Anchor to Possible typesPossible types
- •OBJECT
A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse.
- Anchor to descriptiondescription•String!non-null
Stripped description of the collection, single line with HTML tags removed.
- Anchor to truncateAttruncate•Int
At Truncates a string after the given length.
Arguments
- Anchor to descriptionHtmldescription•HTML!
Html non-null The description of the collection, complete with HTML formatting.
- Anchor to handlehandle•String!non-null
A human-friendly unique string for the collection automatically generated from its title. Limit of 255 characters.
- •ID!non-null
A globally-unique ID.
- Anchor to imageimage•Image
Image associated with the collection.
- Anchor to metafieldmetafield•Metafield
A custom field, including its
namespace
andkey
, that's associated with a Shopify resource for the purposes of adding and storing additional information.- Anchor to metafieldsmetafields•[Metafield]!non-null
A list of custom fields that a merchant associates with a Shopify resource.
- Anchor to onlineStoreUrlonline•URL
Store Url The URL used for viewing the resource on the shop's Online Store. Returns
null
if the resource is currently not published to the Online Store sales channel.- Anchor to productsproducts•Product
Connection! non-null List of products in the collection.
- •SEO!non-null
The collection's SEO information.
- Anchor to titletitle•String!non-null
The collection’s name. Limit of 255 characters.
- Anchor to trackingParameterstracking•String
Parameters URL parameters to be added to a page URL to track the origin of on-site search traffic for analytics reporting. Returns a result when accessed through the search or predictiveSearch queries, otherwise returns null.
- Anchor to updatedAtupdated•Date
At Time! non-null The date and time when the collection was last modified.
- •OBJECT
The generic file resource lets you manage files in a merchant’s store. Generic files include any file that doesn’t fit into a designated type such as image or video. Example: PDF, JSON.
- •String
A word or phrase to indicate the contents of a file.
- •ID!non-null
A globally-unique ID.
- Anchor to mimeTypemime•String
Type The MIME type of the file.
- Anchor to originalFileSizeoriginal•Int
File Size The size of the original file in bytes.
- Anchor to previewImagepreview•Image
Image The preview image for the file.
- •URL
The URL of the file.
- •OBJECT
Represents a Shopify hosted image.
- •String
A word or phrase to share the nature or contents of a media.
- •ID!non-null
A globally-unique ID.
- Anchor to imageimage•Image
The image for the media.
- Anchor to mediaContentTypemedia•Media
Content Type Content Type! non-null The media content type.
- Anchor to presentationpresentation•Media
Presentation The presentation for a media.
- Anchor to previewImagepreview•Image
Image The preview image for the media.
- •OBJECT
An instance of a user-defined model based on a MetaobjectDefinition.
- Anchor to fieldfield•Metaobject
Field Accesses a field of the object by key.
- Anchor to fieldsfields•[Metaobject
Field!]! non-null All object fields with defined values. Omitted object keys can be assumed null, and no guarantees are made about field order.
- Anchor to handlehandle•String!non-null
The unique handle of the metaobject. Useful as a custom ID.
- •ID!non-null
A globally-unique ID.
- Anchor to onlineStoreUrlonline•URL
Store Url The URL used for viewing the metaobject on the shop's Online Store. Returns
null
if the metaobject definition doesn't have thecapability.
- •Metaobject
SEO The metaobject's SEO information. Returns
null
if the metaobject definition doesn't have therenderable
capability.- Anchor to typetype•String!non-null
The type of the metaobject. Defines the namespace of its associated metafields.
- Anchor to updatedAtupdated•Date
At Time! non-null The date and time when the metaobject was last updated.
- •OBJECT
Represents a Shopify hosted 3D model.
- •String
A word or phrase to share the nature or contents of a media.
- •ID!non-null
A globally-unique ID.
- Anchor to mediaContentTypemedia•Media
Content Type Content Type! non-null The media content type.
- Anchor to presentationpresentation•Media
Presentation The presentation for a media.
- Anchor to previewImagepreview•Image
Image The preview image for the media.
- Anchor to sourcessources•[Model3d
Source!]! non-null The sources for a 3d model.
- •OBJECT
Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom page on the online store.
- Anchor to bodybody•HTML!non-null
The description of the page, complete with HTML formatting.
- Anchor to bodySummarybody•String!
Summary non-null Summary of the page body.
- Anchor to createdAtcreated•Date
At Time! non-null The timestamp of the page creation.
- Anchor to handlehandle•String!non-null
A human-friendly unique string for the page automatically generated from its title.
- •ID!non-null
A globally-unique ID.
- Anchor to metafieldmetafield•Metafield
A custom field, including its
namespace
andkey
, that's associated with a Shopify resource for the purposes of adding and storing additional information.- Anchor to metafieldsmetafields•[Metafield]!non-null
A list of custom fields that a merchant associates with a Shopify resource.
- Anchor to onlineStoreUrlonline•URL
Store Url The URL used for viewing the resource on the shop's Online Store. Returns
null
if the resource is currently not published to the Online Store sales channel.- •SEO
The page's SEO information.
- Anchor to titletitle•String!non-null
The title of the page.
- Anchor to trackingParameterstracking•String
Parameters URL parameters to be added to a page URL to track the origin of on-site search traffic for analytics reporting. Returns a result when accessed through the search or predictiveSearch queries, otherwise returns null.
- Anchor to updatedAtupdated•Date
At Time! non-null The timestamp of the latest page update.
- •OBJECT
The
Product
object lets you manage products in a merchant’s store.Products are the goods and services that merchants offer to customers. They can include various details such as title, description, price, images, and options such as size or color. You can use product variants to create or update different versions of the same product. You can also add or update product media. Products can be organized by grouping them into a collection.
Learn more about working with products and collections.
- Anchor to adjacentVariantsadjacent•[Product
Variants Variant!]! non-null A list of variants whose selected options differ with the provided selected options by one, ordered by variant id. If selected options are not provided, adjacent variants to the first available variant is returned.
Note that this field returns an array of variants. In most cases, the number of variants in this array will be low. However, with a low number of options and a high number of values per option, the number of variants returned here can be high. In such cases, it recommended to avoid using this field.
This list of variants can be used in combination with the
options
field to build a rich variant picker that includes variant availability or other variant information.- Anchor to availableForSaleavailable•Boolean!
For Sale non-null Indicates if at least one product variant is available for sale.
- Anchor to categorycategory•Taxonomy
Category The category of a product from Shopify's Standard Product Taxonomy.
- Anchor to collectionscollections•Collection
Connection! non-null A list of collections that include the product.
- Anchor to compareAtPriceRangecompare•Product
At Price Range Price Range! non-null The compare-at price range of the product in the shop's default currency.
- Anchor to createdAtcreated•Date
At Time! non-null The date and time when the product was created.
- Anchor to descriptiondescription•String!non-null
A single-line description of the product, with HTML tags removed.
- Anchor to truncateAttruncate•Int
At Truncates a string after the given length.
Arguments
- Anchor to descriptionHtmldescription•HTML!
Html non-null The description of the product, with HTML tags. For example, the description might include bold
<strong></strong>
and italic<i></i>
text.- Anchor to encodedVariantAvailabilityencoded•String
Variant Availability An encoded string containing all option value combinations with a corresponding variant that is currently available for sale.
Integers represent option and values: [0,1] represents option_value at array index 0 for the option at array index 0
:
,,
,-
are control characters.:
indicates a new option. ex: 0:1 indicates value 0 for the option in position 1, value 1 for the option in position 2.,
indicates the end of a repeated prefix, mulitple consecutive commas indicate the end of multiple repeated prefixes.-
indicates a continuous range of option values. ex: 0 1-3 4Decoding process:
Example options: [Size, Color, Material] Example values: [[Small, Medium, Large], [Red, Blue], [Cotton, Wool]] Example encoded string: "0:0:0,1:0-1,,1:0:0-1,1:1,,2:0:1,1:0,,"
Step 1: Expand ranges into the numbers they represent: "0:0:0,1:0 1,,1:0:0 1,1:1,,2:0:1,1:0,," Step 2: Expand repeated prefixes: "0:0:0,0:1:0 1,1:0:0 1,1:1:1,2:0:1,2:1:0," Step 3: Expand shared prefixes so data is encoded as a string: "0:0:0,0:1:0,0:1:1,1:0:0,1:0:1,1:1:1,2:0:1,2:1:0," Step 4: Map to options + option values to determine existing variants:
[Small, Red, Cotton] (0:0:0), [Small, Blue, Cotton] (0:1:0), [Small, Blue, Wool] (0:1:1), [Medium, Red, Cotton] (1:0:0), [Medium, Red, Wool] (1:0:1), [Medium, Blue, Wool] (1:1:1), [Large, Red, Wool] (2:0:1), [Large, Blue, Cotton] (2:1:0).
- Anchor to encodedVariantExistenceencoded•String
Variant Existence An encoded string containing all option value combinations with a corresponding variant.
Integers represent option and values: [0,1] represents option_value at array index 0 for the option at array index 0
:
,,
,-
are control characters.:
indicates a new option. ex: 0:1 indicates value 0 for the option in position 1, value 1 for the option in position 2.,
indicates the end of a repeated prefix, mulitple consecutive commas indicate the end of multiple repeated prefixes.-
indicates a continuous range of option values. ex: 0 1-3 4Decoding process:
Example options: [Size, Color, Material] Example values: [[Small, Medium, Large], [Red, Blue], [Cotton, Wool]] Example encoded string: "0:0:0,1:0-1,,1:0:0-1,1:1,,2:0:1,1:0,,"
Step 1: Expand ranges into the numbers they represent: "0:0:0,1:0 1,,1:0:0 1,1:1,,2:0:1,1:0,," Step 2: Expand repeated prefixes: "0:0:0,0:1:0 1,1:0:0 1,1:1:1,2:0:1,2:1:0," Step 3: Expand shared prefixes so data is encoded as a string: "0:0:0,0:1:0,0:1:1,1:0:0,1:0:1,1:1:1,2:0:1,2:1:0," Step 4: Map to options + option values to determine existing variants:
[Small, Red, Cotton] (0:0:0), [Small, Blue, Cotton] (0:1:0), [Small, Blue, Wool] (0:1:1), [Medium, Red, Cotton] (1:0:0), [Medium, Red, Wool] (1:0:1), [Medium, Blue, Wool] (1:1:1), [Large, Red, Wool] (2:0:1), [Large, Blue, Cotton] (2:1:0).
- Anchor to featuredImagefeatured•Image
Image The featured image for the product.
This field is functionally equivalent to
images(first: 1)
.- Anchor to handlehandle•String!non-null
A unique, human-readable string of the product's title. A handle can contain letters, hyphens (
-
), and numbers, but no spaces. The handle is used in the online store URL for the product.- •ID!non-null
A globally-unique ID.
- Anchor to imagesimages•Image
Connection! non-null List of images associated with the product.
- Anchor to isGiftCardis•Boolean!
Gift Card non-null Whether the product is a gift card.
- Anchor to mediamedia•Media
Connection! non-null The media that are associated with the product. Valid media are images, 3D models, videos.
- Anchor to metafieldmetafield•Metafield
A custom field, including its
namespace
andkey
, that's associated with a Shopify resource for the purposes of adding and storing additional information.- Anchor to metafieldsmetafields•[Metafield]!non-null
A list of custom fields that a merchant associates with a Shopify resource.
- Anchor to onlineStoreUrlonline•URL
Store Url The product's URL on the online store. If
null
, then the product isn't published to the online store sales channel.- Anchor to optionsoptions•[Product
Option!]! non-null A list of product options. The limit is defined by the shop's resource limits for product options (
).
- Anchor to priceRangeprice•Product
Range Price Range! non-null The minimum and maximum prices of a product, expressed in decimal numbers. For example, if the product is priced between $10.00 and $50.00, then the price range is $10.00 - $50.00.
- Anchor to productTypeproduct•String!
Type non-null The product type that merchants define.
- Anchor to publishedAtpublished•Date
At Time! non-null The date and time when the product was published to the channel.
- Anchor to requiresSellingPlanrequires•Boolean!
Selling Plan non-null Whether the product can only be purchased with a selling plan. Products that are sold on subscription (
) can be updated only for online stores. If you update a product to be subscription-only (
), then the product is unpublished from all channels, except the online store.
- Anchor to selectedOrFirstAvailableVariantselected•Product
Or First Available Variant Variant Find an active product variant based on selected options, availability or the first variant.
All arguments are optional. If no selected options are provided, the first available variant is returned. If no variants are available, the first variant is returned.
- Anchor to sellingPlanGroupsselling•Selling
Plan Groups Plan Group Connection! non-null A list of all selling plan groups that are associated with the product either directly, or through the product's variants.
- •SEO!non-null
The SEO title and description that are associated with a product.
- •[String!]!non-null
A comma-separated list of searchable keywords that are associated with the product. For example, a merchant might apply the
sports
andsummer
tags to products that are associated with sportwear for summer. Updatingtags
overwrites any existing tags that were previously added to the product. To add new tags without overwriting existing tags, use the GraphQL Admin API'smutation.
- Anchor to titletitle•String!non-null
The name for the product that displays to customers. The title is used to construct the product's handle. For example, if a product is titled "Black Sunglasses", then the handle is
black-sunglasses
.- Anchor to totalInventorytotal•Int
Inventory The quantity of inventory that's in stock.
- Anchor to trackingParameterstracking•String
Parameters URL parameters to be added to a page URL to track the origin of on-site search traffic for analytics reporting. Returns a result when accessed through the search or predictiveSearch queries, otherwise returns null.
- Anchor to updatedAtupdated•Date
At Time! non-null The date and time when the product was last modified. A product's
value can change for different reasons. For example, if an order is placed for a product that has inventory tracking set up, then the inventory adjustment is counted as an update.
- Anchor to variantBySelectedOptionsvariant•Product
By Selected Options Variant Find a product’s variant based on its selected options. This is useful for converting a user’s selection of product options into a single matching variant. If there is not a variant for the selected options,
null
will be returned.- Anchor to variantsvariants•Product
Variant Connection! non-null A list of variants that are associated with the product.
- Anchor to variantsCountvariants•Count
Count The number of variants that are associated with the product.
- Anchor to vendorvendor•String!non-null
The name of the product's vendor.
- •OBJECT
A product variant represents a different version of a product, such as differing sizes or differing colors.
- Anchor to availableForSaleavailable•Boolean!
For Sale non-null Indicates if the product variant is available for sale.
- Anchor to barcodebarcode•String
The barcode (for example, ISBN, UPC, or GTIN) associated with the variant.
- Anchor to compareAtPricecompare•Money
At Price V2 The compare at price of the variant. This can be used to mark a variant as on sale, when
is higher than
price
.- Anchor to componentscomponents•Product
Variant Component Connection! non-null List of bundles components included in the variant considering only fixed bundles.
- Anchor to currentlyNotInStockcurrently•Boolean!
Not In Stock non-null Whether a product is out of stock but still available for purchase (used for backorders).
- Anchor to groupedBygrouped•Product
By Variant Connection! non-null List of bundles that include this variant considering only fixed bundles.
- •ID!non-null
A globally-unique ID.
- Anchor to imageimage•Image
Image associated with the product variant. This field falls back to the product image if no image is available.
- Anchor to metafieldmetafield•Metafield
A custom field, including its
namespace
andkey
, that's associated with a Shopify resource for the purposes of adding and storing additional information.- Anchor to metafieldsmetafields•[Metafield]!non-null
A list of custom fields that a merchant associates with a Shopify resource.
- Anchor to priceprice•Money
V2! non-null The product variant’s price.
- Anchor to productproduct•Product!non-null
The product object that the product variant belongs to.
- Anchor to quantityAvailablequantity•Int
Available The total sellable quantity of the variant for online sales channels.
- Anchor to quantityPriceBreaksquantity•Quantity
Price Breaks Price Break Connection! non-null A list of quantity breaks for the product variant.
- Anchor to quantityRulequantity•Quantity
Rule Rule! non-null The quantity rule for the product variant in a given context.
- Anchor to requiresComponentsrequires•Boolean!
Components non-null Whether a product variant requires components. The default value is
false
. Iftrue
, then the product variant can only be purchased as a parent bundle with components.- Anchor to requiresShippingrequires•Boolean!
Shipping non-null Whether a customer needs to provide a shipping address when placing an order for the product variant.
- Anchor to selectedOptionsselected•[Selected
Options Option!]! non-null List of product options applied to the variant.
- Anchor to sellingPlanAllocationsselling•Selling
Plan Allocations Plan Allocation Connection! non-null Represents an association between a variant and a selling plan. Selling plan allocations describe which selling plans are available for each variant, and what their impact is on pricing.
- Anchor to shopPayInstallmentsPricingshop•Shop
Pay Installments Pricing Pay Installments Product Variant Pricing The Shop Pay Installments pricing information for the product variant.
- •String
The SKU (stock keeping unit) associated with the variant.
- Anchor to storeAvailabilitystore•Store
Availability Availability Connection! non-null The in-store pickup availability of this variant by location.
- Anchor to taxabletaxable•Boolean!non-null
Whether tax is charged when the product variant is sold.
- Anchor to titletitle•String!non-null
The product variant’s title.
- Anchor to unitPriceunit•Money
Price V2 The unit price value for the variant based on the variant's measurement.
- Anchor to unitPriceMeasurementunit•Unit
Price Measurement Price Measurement The unit price measurement for the variant.
- Anchor to weightweight•Float
The weight of the product variant in the unit system specified with
.
- Anchor to weightUnitweight•Weight
Unit Unit! non-null Unit of measurement for weight.
- Anchor to compareAtPriceV2compare•Money
At Price V2 V2 Deprecated - Anchor to priceV2price•Money
V2 V2! non-nullDeprecated
- •OBJECT
Represents a Shopify hosted video.
- •String
A word or phrase to share the nature or contents of a media.
- •ID!non-null
A globally-unique ID.
- Anchor to mediaContentTypemedia•Media
Content Type Content Type! non-null The media content type.
- Anchor to presentationpresentation•Media
Presentation The presentation for a media.
- Anchor to previewImagepreview•Image
Image The preview image for the media.
- Anchor to sourcessources•[Video
Source!]! non-null The sources for a video.
Anchor to Fields with this unionFields with this union
- •OBJECT
Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are comprised of keys, values, and value types.
- •OBJECT
Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are comprised of keys, values, and value types.
- •CONNECTION
An auto-generated type for paginating through multiple MetafieldReferences.
- •OBJECT
An auto-generated type which holds one MetafieldReference and a cursor during pagination.
- •OBJECT
Provides the value of a Metaobject field.
- •OBJECT
Provides the value of a Metaobject field.