Basic Usage
const queryData = {
query:`
query {
hello,
persons {
name,
}
}`
};
const headers = new Headers({
"Accept" : "application/json",
"Content-Type" : "application/json"
});
const fetchPromise = fetch('/graphql', {
headers,
method: "POST",
body: JSON.stringify(queryData),
});
fetchPromise
.then(response => response.clone().json()) // avoid reponse lock
.then(data => console.log);