I wish to pull in filtered product data via JavaScript from within a Magento module? Using graphql to only retrieve the data I want.
I can do this using the various graphql endpoints, however, I'm currently doing this by converting the HTTP calls to jQuery in Postman (for the moment). This feels messy.
It's a much simpler task when calling from a React or other SPA as I'd just use axios, Apollo etc.
From what I have read, the Magento dev docs do not include any specific approach to calling graphql endpoints within classic Magento 2 modules.
What would the most efficient way to approach this?