-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move graphql queries to own crate
Signed-off-by: Gustavo Inacio <[email protected]>
- Loading branch information
Showing
28 changed files
with
170 additions
and
110 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "indexer-query" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
graphql_client.workspace = true | ||
thegraph-core.workspace = true | ||
serde.workspace = true | ||
alloy.workspace = true | ||
anyhow.workspace = true |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
use graphql_client::GraphQLQuery; | ||
|
||
pub mod dispute_manager { | ||
use alloy::primitives::Address; | ||
use graphql_client::GraphQLQuery; | ||
type Bytes = Address; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/network.schema.graphql", | ||
query_path = "graphql/dispute.query.graphql", | ||
response_derives = "Debug", | ||
variables_derives = "Clone" | ||
)] | ||
pub struct DisputeManager; | ||
|
||
pub use dispute_manager::Variables; | ||
} | ||
|
||
pub mod escrow_account { | ||
use graphql_client::GraphQLQuery; | ||
type BigInt = String; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/tap.schema.graphql", | ||
query_path = "graphql/escrow_account.query.graphql", | ||
response_derives = "Debug", | ||
variables_derives = "Clone" | ||
)] | ||
pub struct EscrowAccountQuery; | ||
|
||
pub use escrow_account_query::Variables; | ||
} | ||
|
||
pub mod allocations_query { | ||
use alloy::primitives::{B256, U256}; | ||
use graphql_client::GraphQLQuery; | ||
type BigInt = U256; | ||
type Bytes = B256; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/network.schema.graphql", | ||
query_path = "graphql/allocations.query.graphql", | ||
response_derives = "Debug", | ||
variables_derives = "Clone" | ||
)] | ||
pub struct AllocationsQuery; | ||
|
||
pub use allocations_query::*; | ||
} | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/indexing_status.schema.graphql", | ||
query_path = "graphql/subgraph_health.query.graphql", | ||
response_derives = "Debug", | ||
variables_derives = "Clone" | ||
)] | ||
pub struct HealthQuery; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/network.schema.graphql", | ||
query_path = "graphql/epoch.query.graphql", | ||
response_derives = "Debug", | ||
variables_derives = "Clone" | ||
)] | ||
pub struct CurrentEpoch; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/test.schema.graphql", | ||
query_path = "graphql/user.query.graphql", | ||
response_derives = "Debug", | ||
variables_derives = "Clone" | ||
)] | ||
pub struct UserQuery; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/indexing_status.schema.graphql", | ||
query_path = "graphql/subgraph_deployment_status.graphql", | ||
response_derives = "Debug", | ||
variables_derives = "Clone" | ||
)] | ||
pub struct DeploymentStatusQuery; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/tap.schema.graphql", | ||
query_path = "graphql/unfinalized_tx.query.graphql", | ||
response_derives = "Debug", | ||
variables_derives = "Clone" | ||
)] | ||
pub struct UnfinalizedTransactions; | ||
|
||
pub mod closed_allocations { | ||
use graphql_client::GraphQLQuery; | ||
|
||
type Bytes = String; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/network.schema.graphql", | ||
query_path = "graphql/closed_allocations.query.graphql", | ||
response_derives = "Debug", | ||
variables_derives = "Clone" | ||
)] | ||
pub struct ClosedAllocations; | ||
pub use closed_allocations::*; | ||
} | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/tap.schema.graphql", | ||
query_path = "graphql/transactions.query.graphql", | ||
response_derives = "Debug", | ||
variables_derives = "Clone" | ||
)] | ||
pub struct TapTransactions; |
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
Oops, something went wrong.