Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using GraphQL by Javascript
const query = `
query{
bitcoin{
blocks{
count
}
}
}
`;
const url = "https://graphql.bitquery.io/";
const opts = {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
query
})
};
fetch(url, opts)
.then(res => res.json())
.then(console.log)
.catch(console.error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.