Search
 
SCRIPT & CODE EXAMPLE
 

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
      });
    });
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: merge-sort js 
Javascript :: typescript interface with unknown keys 
Javascript :: unix to date in javascript 
Javascript :: date javascript format 
Javascript :: jquery show hide based on data attribute 
Javascript :: grayscale image in canvas 
Javascript :: jquery get img src 
Javascript :: debouncing js 
Javascript :: jquery chrome extension 
Javascript :: call json api javascript 
Javascript :: editor js to html 
Javascript :: replace each string by another string javascript 
Javascript :: react native custom debounce input 
Javascript :: queryselectorall in javascript to get data attribute value 
Javascript :: ng model on change 
Javascript :: anagram program in javascript 
Javascript :: jquery select html element 
Javascript :: react build command 
Javascript :: async useeffect 
Javascript :: react router route not found redirect 
Javascript :: npm sendgrid 
Javascript :: setting usestate to prop 
Javascript :: how to validate email in node js 
Javascript :: jquery detect shift tab 
Javascript :: mongoose save or update 
Javascript :: declare an array nodejs 
Javascript :: ubuntu internet speed booster 
Javascript :: dynamic navigation with subitems 
Javascript :: javascript hypot 
Javascript :: require mongoose 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =