A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Using the REST API to fetch orders, and we have a couple of custom metafields we need to fetch. We have five different stores which all have the same metafield, but as it's created by the Qikify Checkout app, we don't have control over the field ID.
We thought it would make sense to use the description
field, but it looks like the REST API returns description
as blank, even when it has a value.
Is this a bug with the Shopify API? To test it wasn't an issue with the Qikify app creating the fields we created one manually, with a description, but when fetching it via the REST API it still didn't have a description. Any ideas?
Hi Indextwo,
I just created a test store, added a Metafield with a description and performed a curl GET and did see the description get returned. Is there a specific store (maybe a test store) that is exhibiting this behavior that I could take a look at?
Thanks,
-Rick
To learn more visit the Shopify Help Center or the Community Blog.
Got a test store - hoover-checkout-test.myshopify.com
and testing with order number 5313079312677
.
The endpoint I'm using is /admin/api/2023-01/orders/5313079312677/metafields.json
Let me know if you need access, and thanks for looking!
I do see the description on the MetafieldDefinition, however it has not been applied to the Metafields themselves. Unfortunately accessing the MetafieldDefinition only available in GraphQL. I understand the intuition that the MetafieldDefinition.description would cascade to the Metafields themselves, however as it works right now the Metafields have their own descriptions independent of their definition.
I also recognize that these Metafields are coming from a different app, therefore it is not easy to update the individual Metafields.
This is not what you are looking for, but the following would work in GraphQL:
query MetafieldsQuery {
metafields(owner:"gid://shopify/Order/5313079312677", first:10) {
nodes {
id
namespace
key
value
description:definition {
description
}
}
}
}
To learn more visit the Shopify Help Center or the Community Blog.
Thanks for the quick reply. The Qikify developers have been very helpful and they suggested the same thing. Unfortunately it's the end client who's using the REST API (hence why we were testing it that way), so it looks like we won't be able to use the description to discern the fields as we thought. Thanks anyway.