Skip to content

Commit 585876a

Browse files
authored
Add hasura API schema. (#14)
* Add hasura API schema.
1 parent 0d998ed commit 585876a

File tree

3 files changed

+21790
-0
lines changed

3 files changed

+21790
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,19 @@ This is expected since the node doesn't store all staking pool for all heights.
7373
In case you want to integrate the indexing if the custom types, for example parameters,
7474
that [PR](https://github.com/CoreumFoundation/bdjuno/pull/4)
7575
can be taken as a reference implementation.
76+
77+
## Hasura API
78+
79+
### GraphQL Schema
80+
81+
The GraphQL schema is located [here](./hasura/api/schema.graphql). It describes all supported queries.
82+
83+
In order to export it you can run the hasura locally and execute script
84+
85+
```
86+
npm install -g graphqurl # install the gq
87+
gq http://localhost:8080/v1/graphql -H "X-Hasura-Admin-Secret: myadminsecretkey" --introspect > schema.graphql # export schema
88+
```
89+
90+
Pay attention that `myadminsecretkey` is the secret set for this repo local environment, and can be different for
91+
others.

hasura/api/.graphqlconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "Explorer Schema",
3+
"schemaPath": "schema.graphql",
4+
"extensions": {
5+
"endpoints": {
6+
"Remote SWAPI GraphQL Endpoint": {
7+
"url": "http://localhost:8080/v1/graphql",
8+
"headers": {
9+
"user-agent": "JS GraphQL"
10+
},
11+
"introspect": true
12+
}
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)