I'm querying the graphql endpoint of a magento test installation, and am constructing and sending an oauth 1.0 authorization header via an integration setup.
When I query the products via a simple graphql query like so:
query Products {
 products(
 filter: { price: { from: "0" } }
 pageSize: 20
 currentPage: 1
 sort: { name: DESC }
 ) {
 items {
 sku
 }
 }
}
I get no data as a result -
{
 "data": {
 "products": {
 "items": []
 }
 }
}
Could it be an issue with the authorization header? I've tested the header via the REST routes and it works ok there.
Thanks
- 
 just check in admin if filter is enabled for price attribute, also querying does not require any authorization in graphql, also i hope you already have checked with reindexing.Pramod– Pramod2023年10月05日 16:08:40 +00:00Commented Oct 5, 2023 at 16:08
- 
 Ah that's interesting Pramod, thank you. I'm not at my machine rn but they all sound like things that could work. Glad the Auth is not the issue in this case so I can concentrate on that. I will need Auth for mutations in future so work is not lost there.Steve Driscoll– Steve Driscoll2023年10月05日 17:29:14 +00:00Commented Oct 5, 2023 at 17:29
- 
 auth will be required in case of getting or updadting customer data such as order,address requires (requires customer token) wheres as loading all the orders irrespective of user requires integration tokenPramod– Pramod2023年10月07日 05:30:39 +00:00Commented Oct 7, 2023 at 5:30
1 Answer 1
You don't need any auth info for GQL.
You are missing to filter for price. Below query should work:
query Products {
 products(
 filter: { price: { from: 0, to: 500 } }
 pageSize: 20
 currentPage: 1
 sort: { name: DESC }
 ) {
 items {
 sku
 }
 }
}