In following projects includes two files for diffrent purposes
query.js
- Runs only one time and quries all the dataqueryContinuous.js
- Runs continuosly and wait for 14sec after quering again
Well there are many was of querying data from subgraph, but i have use https endpoint way with axios
.
- axios
- Install all the dependencies
npm install
- Adding you subgraph https endpoint in both files
const uniswapURL = <-Change-It-Here->
- Changing schema accordingly, depending upon what data to get
NOTE : _meta in schema is to get the current block in file
queryContinous.js
- Running it
node <FileName>
Sufiyan