The community member is trying to access data from a GraphQL data source in a script, but they don't want to expose that data in the DOM. The comments suggest that they can bind the data within an HTML embed and assign it to a variable, but the community member is concerned that this would still reveal the data in the script. Eventually, the community member decides to set up a worker to handle the data access, which allows them to make requests to Shopify's GraphQL resources without exposing the data in the DOM.
I'm wanting to write a script that would access data pulled from a graphql data source in the data variable. Is there a way to access this data through the DOM?
ok so there is no way to do it without revealing the variable in the script? I'm trying to build a headless Shopify store and I want to pull in the product data but I don't want to expose it to the DOM cause it will have some data I don't really want exposed
it would have been good to be able to make additional queries to shopify using the stored access tokens or data thats all didn't really want to expose that stuff