Skip to content
Snippets Groups Projects
Commit b2c9ed0a authored by Hugo Trentesaux's avatar Hugo Trentesaux Committed by Hugo Trentesaux
Browse files

cli schema update

parent fbf95014
No related branches found
No related tags found
1 merge request!18add info on idty view
...@@ -2,6 +2,15 @@ ...@@ -2,6 +2,15 @@
## Graphql schema and queries for Duniter indexer ## Graphql schema and queries for Duniter indexer
Update the schema with:
```sh
# install graphql client cli
cargo install graphql_client_cli
# download schema from node
graphql-client introspect-schema https://subsquid.gdev.coinduf.eu/graphql --output ./res/indexer-schema.json
```
... ...
## Metadata ## Metadata
...@@ -9,6 +18,8 @@ ...@@ -9,6 +18,8 @@
To update the scale-encoded Duniter metadata, spawn a node and run the subxt command. To update the scale-encoded Duniter metadata, spawn a node and run the subxt command.
```sh ```sh
# install subxt
cargo install subxt
# spawn a node listening on localhost:9944 # spawn a node listening on localhost:9944
duniter --dev duniter --dev
# fetch the metadata with subxt # fetch the metadata with subxt
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -10,7 +10,7 @@ use crate::*; ...@@ -10,7 +10,7 @@ use crate::*;
// index → identity // index → identity
#[derive(GraphQLQuery)] #[derive(GraphQLQuery)]
#[graphql( #[graphql(
schema_path = "res/indexer-schema.graphql", schema_path = "res/indexer-schema.json",
query_path = "res/indexer-queries.graphql" query_path = "res/indexer-queries.graphql"
)] )]
pub struct IdentityByIndex; pub struct IdentityByIndex;
...@@ -18,7 +18,7 @@ pub struct IdentityByIndex; ...@@ -18,7 +18,7 @@ pub struct IdentityByIndex;
// // name → identity // // name → identity
// #[derive(GraphQLQuery)] // #[derive(GraphQLQuery)]
// #[graphql( // #[graphql(
// schema_path = "res/indexer-schema.graphql", // schema_path = "res/indexer-schema.json",
// query_path = "res/indexer-queries.graphql" // query_path = "res/indexer-queries.graphql"
// )] // )]
// pub struct IdentityByName; // pub struct IdentityByName;
...@@ -26,21 +26,21 @@ pub struct IdentityByIndex; ...@@ -26,21 +26,21 @@ pub struct IdentityByIndex;
// pubkey → identity // pubkey → identity
#[derive(GraphQLQuery)] #[derive(GraphQLQuery)]
#[graphql( #[graphql(
schema_path = "res/indexer-schema.graphql", schema_path = "res/indexer-schema.json",
query_path = "res/indexer-queries.graphql" query_path = "res/indexer-queries.graphql"
)] )]
pub struct IdentityByPubkey; pub struct IdentityByPubkey;
#[derive(GraphQLQuery)] #[derive(GraphQLQuery)]
#[graphql( #[graphql(
schema_path = "res/indexer-schema.graphql", schema_path = "res/indexer-schema.json",
query_path = "res/indexer-queries.graphql" query_path = "res/indexer-queries.graphql"
)] )]
pub struct LatestBlock; pub struct LatestBlock;
#[derive(GraphQLQuery)] #[derive(GraphQLQuery)]
#[graphql( #[graphql(
schema_path = "res/indexer-schema.graphql", schema_path = "res/indexer-schema.json",
query_path = "res/indexer-queries.graphql" query_path = "res/indexer-queries.graphql"
)] )]
pub struct GenesisHash; pub struct GenesisHash;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment