Metafields
Retrieves a list of metafields that belong to a resource.
Table-Specific Information
OwnerResource or the metafield Id (when executing non-bulk operations) is required for any query against Metafields.
Select
The server uses the Shopify API to process WHERE clause conditions built with the following columns and operators. The server processes other filters client-side within the server.
- Id supports the '=, IN' comparison operators.
- OwnerId supports the '=, IN' comparison operators.
- OwnerResource supports the '=' comparison operator.
For example, the following queries are processed server-side:
SELECT * FROM Metafields WHERE Id = 'gid://shopify/Metafield/19334473318423'
SELECT * FROM Metafields WHERE Id IN ('gid://shopify/Metafield/19334473318423', 'gid://shopify/Metafield/19334473318424')
SELECT * FROM Metafields WHERE OwnerResource = 'product'
SELECT * FROM Metafields WHERE OwnerResource = 'variant' AND OwnerId = 'gid://shopify/ProductVariant/39378393497623'
SELECT * FROM Metafields WHERE OwnerResource = 'variant' AND OwnerId IN ('gid://shopify/ProductVariant/39378393497623', 'gid://shopify/Product/1418248224791')
Insert
The following columns can be used to create a new record:
Namespace, Key, Value, Type, OwnerId
Delete
You can delete entries by specifying the following column:
Id
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | Long | True |
The unique ID of the metafield. | |
| Namespace | String | False |
A container for a set of metafields. You need to define a custom namespace for your metafields to distinguish them from the metafields used by other apps. | |
| Key | String | False |
The name of the metafield. | |
| Value | String | False |
The information to be stored as metadata. | |
| Type | String | False |
The metafield's information type. | |
| Description | String | False |
A description of the information that the metafield contains. | |
| OwnerId | Long | False |
The unique ID of the resource that the metafield is attached to. | |
| OwnerResource | String | False |
The type of resource that the metafield is attached to. The allowed values are shop, draft_order, page, article, order, customer, collection, blog. | |
| CreatedAt | Datetime | True |
The date and time (ISO 8601 format) when the metafield was created. | |
| UpdatedAt | Datetime | True |
The date and time (ISO 8601 format) when the metafield was last updated. | |
| AdminGraphqlApiId | String | True |
The admin graphql api id |