A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi,
When doing a query as e.g. this:
mutation {
bulkOperationRunQuery(
query: """
{
collection(id: "${collectionId}") {
id
products {
edges {
node {
id
}
}
}
}
}
"""
) {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}
usually the resulting json file includes the parent object it-self - in this case the collection - as well as the children - in this case the products.
But currently that is not the case - only the child nodes are included, e.g.:
{"id":"gid:\/\/shopify\/Product\/7379200934070"}
{"id":"gid:\/\/shopify\/Product\/7379175342262"}
{"id":"gid:\/\/shopify\/Product\/7379157614774"}
{"id":"gid:\/\/shopify\/Product\/7379092504758"}
I've tried adding more data to the collection, e.g. title etc. but that does not affect the result.
We're currently using version 2022-04 of the API - 2022-01 does not work either.
Is this really by design? When there are multiple parents in the query, the parents are included in the response.
Look forward to hear any inputs on this.
Thanks,
-Louise