-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
364fffc
commit 6eadfdd
Showing
6 changed files
with
97 additions
and
49 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...r-client/src/query/subgraph/fetch.graphql → .../query/subgraph/fetch/fetch_query.graphql
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,3 @@ | ||
pub mod query_runner; | ||
pub(crate) mod types; | ||
pub use types::{SubgraphFetchInput, SubgraphFetchResponse}; |
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,42 @@ | ||
use super::query_runner::subgraph_fetch_query; | ||
|
||
pub(crate) type ServiceList = Vec<subgraph_fetch_query::SubgraphFetchQueryServiceImplementingServicesOnFederatedImplementingServicesServices>; | ||
pub(crate) type SubgraphFetchResponseData = subgraph_fetch_query::ResponseData; | ||
pub(crate) type Services = subgraph_fetch_query::SubgraphFetchQueryServiceImplementingServices; | ||
pub(crate) type QueryVariables = subgraph_fetch_query::Variables; | ||
|
||
#[derive(Debug, Clone, PartialEq)] | ||
pub struct SubgraphFetchInput { | ||
pub graph_id: String, | ||
pub variant: String, | ||
pub subgraph: String, | ||
} | ||
|
||
#[derive(Debug, Clone, PartialEq)] | ||
pub(crate) struct SubgraphFetchVariables { | ||
graph_id: String, | ||
variant: String, | ||
} | ||
|
||
impl From<SubgraphFetchInput> for SubgraphFetchVariables { | ||
fn from(input: SubgraphFetchInput) -> Self { | ||
Self { | ||
graph_id: input.graph_id, | ||
variant: input.variant, | ||
} | ||
} | ||
} | ||
|
||
impl From<SubgraphFetchVariables> for QueryVariables { | ||
fn from(fetch_variables: SubgraphFetchVariables) -> Self { | ||
Self { | ||
graph_id: fetch_variables.graph_id, | ||
variant: fetch_variables.variant, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Debug, Clone, PartialEq)] | ||
pub struct SubgraphFetchResponse { | ||
pub sdl: String, | ||
} |
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