Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Query errors with created_at and updated_at

Query errors with created_at and updated_at

danieloconnell
Shopify Partner
1 0 0

I have noticed that when using the created_at and updated_at fields I have gotten internal errors. I found the orders, inventoryItems queries have this issue, there may be more as I didn't test all the queries with the created_at and updated_at fields and this issue seems to happen on all API versions.

 

Here is a minimal reproducible example:

 

query ($query: String!) {
  orders(first: 10, query: $query) {
    nodes {
      id
    }
  }
}

using the following as the query as it is an example shown in the docs

 

{
  "query": "created_at:<=2024"
}

the following response is returned

{
  "errors": [
    {
      "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: 32f62540-4000-4144-92c1-24ee610edb41-1727828817 (include this in support requests).",
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "requestId": "32f62540-4000-4144-92c1-24ee610edb41-1727828817"
      }
    }
  ]
}

however when using a full date string eg. 2024-10-01T14:00:00.000Z the error does not happen

 

 

Lastly I noticed that when using the products query the created_at field works however it parses the date incorrectly, again this issue may impact other queries as well I didn't test all the queries.

{
  "data": {
    "products": {
      "nodes": []
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 6,
      "actualQueryCost": 2,
      "throttleStatus": {
        "maximumAvailable": 2000,
        "currentlyAvailable": 1808,
        "restoreRate": 100
      }
    },
    "search": [
      {
        "path": [
          "products"
        ],
        "query": "created_at:<=2024",
        "parsed": {
          "field": "created_at",
          "range_lte": "1970-01-01T00:00:02+00:00"
        }
      }
    ]
  }
}

The parsed date range above seems to be incorrect.

 

Replies 0 (0)