500 Internal Server Error Using shopifyqlQuery

Solved

500 Internal Server Error Using shopifyqlQuery

Novo_Solutions
Tourist
3 1 0

Hi there,

 

I'm using the shopifyqlQuery GraphQL method to pull a custom dataset, and the response returned is:

 

 

{
  "errors": [
    {
      "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: 87893aac-cc01-4e29-b5fc-031335da08e8 (include this in support requests).",
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "requestId": "87893aac-cc01-4e29-b5fc-031335da08e8"
      }
    }
  ]
}

 

 

Here is my complete GraphQL:

 

 

{
  shopifyqlQuery(query: "from sales show day, orders, gross_sales, discounts, returns, net_sales, shipping, duties, additional_fees, taxes, total_sales group by day since -1y until today") {
    __typename
    ... on TableResponse {
      tableData {
        rowData
        columns {
          name
          dataType
          displayName
        }
      }
    }
    parseErrors {
      code
      message
      range {
        start {
          line
          character
        }
        end {
          line
          character
        }
      }
    }
  }
}

 

 

I have Admin API access and I'm passing through all necessary scopes.

 

The API version I'm using is "Unstable" because that's the only one that allows me to use the above function (maybe this is the issue?).

 

I can pull other data just fine, like products for example.

 

Any ideas how to fix this? Any help would be greatly appreciated.

Accepted Solution (1)

Novo_Solutions
Tourist
3 1 0

This is an accepted solution.

I realized my own mistake. When grouping by day, you do not need day in the columns. Updated query that works is:

 

from sales show orders, gross_sales, discounts, returns, net_sales, shipping, duties, additional_fees, taxes, total_sales group by day since -1y until today

View solution in original post

Reply 1 (1)

Novo_Solutions
Tourist
3 1 0

This is an accepted solution.

I realized my own mistake. When grouping by day, you do not need day in the columns. Updated query that works is:

 

from sales show orders, gross_sales, discounts, returns, net_sales, shipping, duties, additional_fees, taxes, total_sales group by day since -1y until today