How to find out the specific term needed for query arguments?

Hi there,

Something confuses me a bit.

How do I find out what term corresponds to a specific field in a query argument?

For instance:

I want to summon my payouts for a specific time range, from July 2024 onwards..

In order to do so, I need to target the “issuedAt” field on the ShopifyPaymentsPayout object.

So, I assumed that the correct query syntax would look like this:

query: “issuedAt>‘2024-07-01’”
However, this gives me the error message:

“message: Invalid search field for this query.”

And I found out that the correct syntax is:

query: “issued_at>‘2024-07-01’”

So, in order to search for the “issuedAt” field, we need to use the “issued_at” term.

I discovered it cause in the search query syntax docs they gave a similar example with the created_at term.

But, my question is, how do I find out what is the correct term? This was a lucky guess. I cannot find it in the docs.

This is my full (working) query:

query GetPayouts {
shopifyPaymentsAccount {
payouts(first: 200 query: “issued_at:>=‘2024-07-01’”) {
edges {
node {
id
issuedAt
net {
amount
currencyCode
}
}
}
}
}
}

Something else, when I change the query to:

query: “issued_at:>=‘2024-07’”

I’m getting the following error response.

Error message: “Internal error. Looks like something went wrong on our end.
Request ID: 8be81573-66c2-4235-91bf-7e95d44863fc-1729264069 (include this in support requests).”

But, that is besides the point of the question.

Since this is a query for “shopifyPaymentsAccount”, you can start by looking at the documentation for that: https://shopify.dev/docs/api/admin-graphql/2024-10/queries/shopifyPaymentsAccount

Then expand “payouts” since that is what you are querying for, then you can see the list of arguments it takes. Then expand query to see the possible queries.

For the issued_at query error, it is because issued_at is a type of time and takes a timestamp so it needs to be a valid timestamp.

See example for querying created_at:

https://shopify.dev/docs/api/usage/search-syntax#using-created_at-in-a-range-query

1 Like