Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

graphql request with jquery ajax

$.gql = async function(query) {
    return new Promise((resolve, reject) => {
      $.ajax({
          url: "https://url/graphql",
          method: 'POST',
          data: JSON.stringify({query}),
          dataType: 'json',
          success: resolve,
          error: reject
      });
    });
}
 
PREVIOUS NEXT
Tagged: #graphql #request #jquery #ajax
ADD COMMENT
Topic
Name
8+3 =