is there any way to call graphql queries in ajax using store front api from my shopify account

Gaganjain
Tourist
8 0 1

I have written graphql query code using java script and ajax, by calling store-front api token, query gives response as well, but it executes for one single information(one parameter) "shop name", but i required more information how i can get exact details

 

var qdata = query { shop { name id email} };

$.ajax({ type:"POST",

  url : ' https://myStoreName.myshopify.com/api/graphql',

   headers: { "X-Shopify-Storefront-Access-Token":"store front access token value", "content-Type":"application/graphql" },

   data: qdata,

   success: function(data){

   console.log(JSON.stringify(data));

    },

    error: function(data){

   console.log(JSON.stringify(data));

  }

});

0 Likes