A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Is the metafieldsSet query available as a bulk query? The documentation for bulk import is unclear as to whether or not you can create metafields using bulk queries. The metafieldsSet query is listed as a bulk mutation under the Limitations header of the docs but a little bit further down under the section Create a bulk mutation it only mentions product & collection mutations, if someone could clarify this it would be highly appreciated.
I have read that it's possible to bulk create/update metafields using the productUpdate mutation but this seems more cumbersome because you have to include the metafield id which I want to avoid by using the metafieldsSet query if that is somehow possible.
Solved! Go to the solution
This is an accepted solution.
Hi @SilasGrygier 👋
The `metafieldsSet` mutation is supported as a bulk operation with `bulkOperationRunMutation`. You should be able to pass the below in a string format, as the `mutation` argument. Keep in mind that the uploaded JSONL file will need to contain `MetafieldSetInput` objects as well.
mutation call($metafields: [MetafieldsSetInput!]!) {
metafieldsSet(metafields: $metafields) {
metafields {
key
namespace
value
createdAt
updatedAt
}
}
}
Hope that helps!
Umiko | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi @SilasGrygier 👋
The `metafieldsSet` mutation is supported as a bulk operation with `bulkOperationRunMutation`. You should be able to pass the below in a string format, as the `mutation` argument. Keep in mind that the uploaded JSONL file will need to contain `MetafieldSetInput` objects as well.
mutation call($metafields: [MetafieldsSetInput!]!) {
metafieldsSet(metafields: $metafields) {
metafields {
key
namespace
value
createdAt
updatedAt
}
}
}
Hope that helps!
Umiko | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog