Last active
June 9, 2021 11:30
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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