A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi my wonderful Shopify community.
I'm running into a bit of a problem using the GraphQL Admin API query filtering. I'll start with the more general problem, and then list my specific prooblem.
The general problem:
The examples I see of filtering the GraphQL Query keep using field names which aren't documented in the GraphQL Admin API docs as far as I can tell.
E.g. this example from the docs uses "inventory_total" to filter products, which isn't documented.
`Product.totalInventory` is, on the other hand, documented. But how would I look at that field and think "hm, I want to filter my products on that field, in my GraphQL Query. I should reverse the order of the words and add an underscore between them." It's not quite intuitive. But perhaps I'm missing some mapping between these two, or some documentation that lists the field names? I thought perhaps it would be the QueryRoot docs, but I can't quite figure out where to look there.
Here's a forum post with the same problem- how did we get from productType, which is listed in the GraphQL to product_type, which isn't listed anywhere, including the QueryRoot documentation that the answerer linked?
Thanks so much folks! This would be a huge help to get answered.
My Specific Problem:
I'm trying to filter Orders that have a non-null shipping address, and `
Solved! Go to the solution
This is an accepted solution.
I found a mostly complete answer: the possible query filter values have been listed (though without any possible values) in the "Queries" subitem under each Object in the GraphQL Admin API Docs. e.g. here is every possible query filter value for Order.
Looking through them, I can see that "shipping_address" isn't filterable.
I hope this is useful to anybody happening upon this. Granted, it doesn't tell you what these field names map to, or what values are possible, but the first one's hopefully intuitive.
This is an accepted solution.
I found a mostly complete answer: the possible query filter values have been listed (though without any possible values) in the "Queries" subitem under each Object in the GraphQL Admin API Docs. e.g. here is every possible query filter value for Order.
Looking through them, I can see that "shipping_address" isn't filterable.
I hope this is useful to anybody happening upon this. Granted, it doesn't tell you what these field names map to, or what values are possible, but the first one's hopefully intuitive.