orders - created_at query questions

Solved
weap0n7
Shopify Partner
18 1 1

Order created_at 2023-09-26T04:46:39Z Order created_at:"created_at:>=2023-09-26T00:00Z created_at:<=2023-09-26T23:59Z" cannot be inquired under this condition.

query:"created_at:>=2023-09-26T00:00Z created_at:<=2023-09-27T23:59:59Z" If you change it to 27th, you can check it. Why is the order on the 26th being viewed as the 27th?

 

 

query {
  orders(first:10  query:"created_at:>=2023-09-26T00:00:00Z created_at:<=2023-09-26T23:59:59Z" ) {
    edges {
      node {
        id
        displayFulfillmentStatus     
        createdAt   
      }
      cursor
    }
    pageInfo{
        endCursor
        hasNextPage
    }
  }
}
{
    "data": {
        "orders": {
            "edges": [],
            "pageInfo": {
                "endCursor": null,
                "hasNextPage": false
            }
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 12,
            "actualQueryCost": 2,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 998,
                "restoreRate": 50.0
            }
        }
    }
}

 

 

query {
  orders(first:10  query:"created_at:>=2023-09-26T00:00:00Z created_at:<=2023-09-27T23:59:59Z" ) {
    edges {
      node {
        id
        displayFulfillmentStatus     
        createdAt   
      }
      cursor
    }
    pageInfo{
        endCursor
        hasNextPage
    }
  }
}
{
    "data": {
        "orders": {
            "edges": [
                {
                    "node": {
                        "id": "gid://shopify/Order/5535043911980",
                        "displayFulfillmentStatus": "UNFULFILLED",
                        "createdAt": "2023-09-26T04:46:39Z"
                    },
                    "cursor": "eyJsYXN0X2lkIjo1NTM1MDQzOTExOTgwLCJsYXN0X3ZhbHVlIjoiMjAyMy0wOS0yNiAwNDo0NjozNy4xODAzOTMifQ=="
                }
            ],
            "pageInfo": {
                "endCursor": "eyJsYXN0X2lkIjo1NTM1MDQzOTExOTgwLCJsYXN0X3ZhbHVlIjoiMjAyMy0wOS0yNiAwNDo0NjozNy4xODAzOTMifQ==",
                "hasNextPage": false
            }
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 12,
            "actualQueryCost": 3,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 997,
                "restoreRate": 50.0
            }
        }
    }
}
Accepted Solution (1)
SBD_
Shopify Staff
Shopify Staff
1602 227 334

This is an accepted solution.

Hey @weap0n7 

 

Looks like you might be missing an 'AND'. Try:

 

query {
  orders(first:10  query:"created_at:>='2023-09-26T00:00:00Z' AND created_at:<='2023-09-26T23:59:59Z'" ) {
    edges {
      node {
        id
        displayFulfillmentStatus     
        createdAt   
      }
      cursor
    }
    pageInfo{
        endCursor
        hasNextPage
    }
  }
}

 

Scott | Developer Advocate @ Shopify 

View solution in original post

Reply 1 (1)
SBD_
Shopify Staff
Shopify Staff
1602 227 334

This is an accepted solution.

Hey @weap0n7 

 

Looks like you might be missing an 'AND'. Try:

 

query {
  orders(first:10  query:"created_at:>='2023-09-26T00:00:00Z' AND created_at:<='2023-09-26T23:59:59Z'" ) {
    edges {
      node {
        id
        displayFulfillmentStatus     
        createdAt   
      }
      cursor
    }
    pageInfo{
        endCursor
        hasNextPage
    }
  }
}

 

Scott | Developer Advocate @ Shopify