Hi, is there a way to get the fulfillment createdAt field on Order Bulk Operation query ? I need that field because it will act as the shipmentDate of my third party app. To check, I also need the fulfillmentLineItems so that I can verify what line item is being fulfilled.
I have tried this query :
orders {
edges {
node {
fulfillments {
createdAt
fulfillmentLineItems {
edges {
node {
lineItem {
id
}
}
}
}
}
}
But this will return an error : “Queries that contain a connection field within
a list field are not currently supported.”
Is there any other possible ways to achieve this ?
Unfortunately, it is not currently possible to retrieve the fulfillment.createdAt field on an Order Bulk Operation query. This is because the fulfillments field is a connection field, which cannot be used within a list field.
One workaround is to use a separate GraphQL query to retrieve the createdAt field for each fulfillment, based on the fulfillmentId value. This can be done using the node field to retrieve a specific fulfillment:
You can then use this query to retrieve the createdAt value for each fulfillment in your original query. However, this approach may not be efficient for large data sets or frequent queries.
Another option is to use the Shopify API to retrieve the createdAt field for each fulfillment. You can use the GET /admin/api/2022-01/orders/{order_id}/fulfillments/{fulfillment_id}.json endpoint to retrieve the created_at field for a specific fulfillment. You can then use this endpoint to retrieve the created_at value for each fulfillment in your list.