Excluding those collection which are marked 'Unavailable on all channels'

Ananthesh
Visitor
3 0 1

Along with the product API, We are fetching collections. Among the collection, there is a requirement to exclude those collection which is marked "Unavailable on all channels". For which, I am have modified GraphQL query to fetch "publishedOnCurrentPublication" field for collection as per it is documented in the documentation here. Here is the query,

 

 

 

 

 

mutation {
  bulkOperationRunQuery(
    query: """ {
      products {
        edges {
          node {
            id
           
            collections(query: "publishable_status:true") {
              edges{
                node{
                    
                  publishedOnCurrentPublication
                  id
                  title
                  handle
                }
              }
            }
          }
        }
      }
    } """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}

 

 

 

 

 

But, I am receiving 500 internal server error from the status API: 

 

 

 

 

 

{
    "data": {
        "currentBulkOperation": {
            "id": "gid://shopify/BulkOperation/603693187206",
            "status": "FAILED",
            "errorCode": "INTERNAL_SERVER_ERROR",
            "createdAt": "2021-12-08T12:30:27Z",
            "completedAt": null,
            "objectCount": "0",
            "fileSize": null,
            "url": null,
            "partialDataUrl": null
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 1,
            "actualQueryCost": 1,
            "throttleStatus": {
                "maximumAvailable": 2000.0,
                "currentlyAvailable": 1999,
                "restoreRate": 100.0
            }
        }
    }
}

 

 

 

 

 

What could be possibly gone wrong here ? 

 

Replies 0 (0)