$.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
});
});
}