Hello,
I’m using the GraphQL API to retrieve the definition of our product metafields.
Unfortunately, I don’t understand why, but my GraphQL query doesn’t want to return all the fields that are visible in the BackOffice.
Here’s the query :
query {
metafieldDefinitions(first: 250, ownerType: PRODUCT) {
edges {
node {
name
key
namespace
description
ownerType
type {
name
category
}
}
}
}
}
Here’s what it returns:
{
"data": {
"metafieldDefinitions": {
"edges": [
{
"node": {
"name": "test",
"key": "test",
"namespace": "custom",
"description": "",
"ownerType": "PRODUCT",
"type": {
"name": "multi_line_text_field",
"category": "TEXT"
}
}
},
{
"node": {
"name": "test2",
"key": "test2",
"namespace": "custom",
"description": null,
"ownerType": "PRODUCT",
"type": {
"name": "multi_line_text_field",
"category": "TEXT"
}
}
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 24,
"actualQueryCost": 4,
"throttleStatus": {
"maximumAvailable": 20000.0,
"currentlyAvailable": 19996,
"restoreRate": 1000.0
}
}
}
}
We see the metafields of the ‘custom’ namespace, but no other namespace, even though they’re present in the BackOffice.
Am I making an error in my query or is this an API limitation?
thank you for your help.