Skip to content

Instantly share code, notes, and snippets.

@sayon-bitquery
Last active June 9, 2021 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayon-bitquery/927b8f9c566edc1d400ef90d496489d2 to your computer and use it in GitHub Desktop.
Save sayon-bitquery/927b8f9c566edc1d400ef90d496489d2 to your computer and use it in GitHub Desktop.
Now, in the src/App.js file, import { useQuery } from ‘react-query’ and make a variable as the endpoint which saves the API endpoint of BitQuery’s GraphQL API i.e. https://graphql/bitquery.io/
import React from "react";
import { useQuery } from "react-query";
const endpoint = "https://graphql.bitquery.io/";
const QUERY = `
{
bitcoin {
blocks(options: {limit: 2}){
height
blockHash
}
}
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment