GraphQL Malformed request for images in collections

Highlighted
Shopify Expert
142 0 25

When we ask Shopify to give us all collections, Shopify is not ready to understand our request and saying that your request is malformed. I have no idea what is the issue. It used to work for more than a year, it suddenly stopped working... could it be related to not specifying the API versioning in the call?

 

This is the error, meaning some GraphQL query we are making is malformed:
Response: %Neuron.Response{
status_code: 200,
body: %{
"errors" => [%{
"locations" => [%{"column" => 9, "line" => 10}],
"message" => "Parse error on \")\" (RPAREN) at [10, 9]"
}]
},
}

 


This is our request:

query Collections($first: Int, $metafieldsFirst: Int) {
  collections(first: $first) {
    edges {
      node {
        updatedAt
        title
        templateSuffix
        productsCount
        image() {
          transformedSrc
          originalSrc
          src
          altText
          id
        }
        handle
        descriptionHtml
        description
        id
        metafields(first: $metafieldsFirst) {
          edges {
            node {
              valueType
              value
              namespace
              key
              description
              id
            }
            cursor
          }
          pageInfo {
            hasNextPage
          }
        }
      }
      cursor
    }
    pageInfo {
      hasNextPage
    }
  }
}





Vars: %{first: 30, metafieldsFirst: 5}

Opts: [
  shop: "edmonton-rv", 
  url: "https://edmonton-rv.myshopify.com/admin/api/graphql.json", 
  headers: [
    "Content-Type": "application/json", 
    "X-Shopify-Access-Token": "62b19c614749f4ba445f44636f18fc79"
  ]
]

Response: %Neuron.Response{
  status_code: 200,
  body: %{
    "errors" => [%{
      "locations" => [%{"column" => 9, "line" => 10}], 
      "message" => "Parse error on \")\" (RPAREN) at [10, 9]"
    }]
  }, 
}
0 Likes
Highlighted
Shopify Staff
Shopify Staff
1040 140 165

The error is highlighting "image() {". The parenthesis can be removed:

...
  image {
    ...
0 Likes