add query examples

This commit is contained in:
Matthias Kretschmann 2020-12-11 00:30:23 +01:00
parent 88154ce0aa
commit 253ba818d6
Signed by: m
GPG Key ID: 606EEEF3C479A91F
1 changed files with 47 additions and 0 deletions

View File

@ -8,6 +8,7 @@
[![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
- [🏄 Get Started](#-get-started)
- [🧶 Example Queries](#-example-queries)
- [🦑 Development](#-development)
- [✨ Code Style](#-code-style)
- [⬆️ Releases](#-releases)
@ -23,6 +24,52 @@ This subgraph is deployed for all networks the Ocean Protocol contracts are depl
- [subgraph.ropsten.oceanprotocol.com](https://subgraph.ropsten.oceanprotocol.com)
- [subgraph.rinkeby.oceanprotocol.com](https://subgraph.ropsten.oceanprotocol.com)
## 🧶 Example Queries
**All pools**
```graphql
{
pools(orderBy: oceanReserve, orderDirection: desc) {
consumePrice
datatokenReserve
oceanReserve
spotPrice
swapFee
transactionCount
}
}
```
**All datatokens**
```graphql
{
datatokens {
address
symbol
name
cap
supply
publisher
holderCount
}
}
```
**All pool transactions for a user**
```graphql
{
poolTransactions(
orderBy: timestamp
where: { userAddressStr: $userAddress }
) {
poolAddressStr
}
}
```
## 🦑 Development
```bash