-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from hasura:header-forwarding
Header-forwarding
- Loading branch information
Showing
16 changed files
with
1,413 additions
and
638 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,35 @@ | ||
use crate::config_file::Header; | ||
use std::collections::BTreeMap; | ||
|
||
use crate::{ | ||
config_file::{RequestConfig, ResponseConfig}, | ||
schema::SchemaDefinition, | ||
}; | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct ServerConfig { | ||
pub connection: ConnectionConfig, | ||
pub schema_string: String, | ||
pub request: RequestConfig<String>, | ||
pub response: ResponseConfig<String>, | ||
pub schema: SchemaDefinition, | ||
} | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct ConnectionConfig { | ||
pub endpoint: String, | ||
pub headers: BTreeMap<String, Header<String>>, | ||
pub headers: BTreeMap<String, String>, | ||
} | ||
|
||
impl ResponseConfig<String> { | ||
pub fn query_response_type_name(&self, query: &str) -> String { | ||
format!( | ||
"{}{}Query{}", | ||
self.type_name_prefix, query, self.type_name_suffix | ||
) | ||
} | ||
pub fn mutation_response_type_name(&self, mutation: &str) -> String { | ||
format!( | ||
"{}{}Mutation{}", | ||
self.type_name_prefix, mutation, self.type_name_suffix | ||
) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod client; | ||
pub mod config; | ||
pub mod config_file; | ||
pub mod schema; |
Oops, something went wrong.