pub struct GraphiQLConfig {
pub endpoint_url: String,
pub subscription_url: Option<String>,
pub theme: GraphiQLTheme,
pub enable_explorer: bool,
pub enable_history: bool,
pub headers: HashMap<String, String>,
pub cdn_url: String,
pub custom_css: Option<String>,
}Expand description
GraphiQL playground configuration
Provides comprehensive configuration for the GraphiQL playground including themes, subscriptions, headers, and interactive features.
Fields§
§endpoint_url: StringGraphQL endpoint URL (required)
subscription_url: Option<String>WebSocket URL for subscriptions (optional)
theme: GraphiQLThemeUI theme (Light or Dark)
enable_explorer: boolEnable schema explorer sidebar
enable_history: boolEnable query history persistence
headers: HashMap<String, String>Custom HTTP headers
cdn_url: StringCDN URL for GraphiQL (for version pinning)
custom_css: Option<String>Custom CSS styling
Implementations§
Source§impl GraphiQLConfig
impl GraphiQLConfig
Sourcepub fn new() -> GraphiQLConfig
pub fn new() -> GraphiQLConfig
Create a new GraphiQL configuration with defaults
Sourcepub fn endpoint_url(self, url: impl Into<String>) -> GraphiQLConfig
pub fn endpoint_url(self, url: impl Into<String>) -> GraphiQLConfig
Set the GraphQL endpoint URL
Sourcepub fn subscription_url(self, url: impl Into<String>) -> GraphiQLConfig
pub fn subscription_url(self, url: impl Into<String>) -> GraphiQLConfig
Set the WebSocket URL for subscriptions
Sourcepub fn theme(self, theme: GraphiQLTheme) -> GraphiQLConfig
pub fn theme(self, theme: GraphiQLTheme) -> GraphiQLConfig
Set the UI theme
Sourcepub fn enable_explorer(self, enable: bool) -> GraphiQLConfig
pub fn enable_explorer(self, enable: bool) -> GraphiQLConfig
Enable or disable the schema explorer
Sourcepub fn enable_history(self, enable: bool) -> GraphiQLConfig
pub fn enable_history(self, enable: bool) -> GraphiQLConfig
Enable or disable query history
Sourcepub fn add_header(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> GraphiQLConfig
pub fn add_header( self, key: impl Into<String>, value: impl Into<String>, ) -> GraphiQLConfig
Add a custom HTTP header
Sourcepub fn cdn_url(self, url: impl Into<String>) -> GraphiQLConfig
pub fn cdn_url(self, url: impl Into<String>) -> GraphiQLConfig
Set the CDN URL for version pinning
Sourcepub fn custom_css(self, css: impl Into<String>) -> GraphiQLConfig
pub fn custom_css(self, css: impl Into<String>) -> GraphiQLConfig
Set custom CSS styling
Trait Implementations§
Source§impl Clone for GraphiQLConfig
impl Clone for GraphiQLConfig
Source§fn clone(&self) -> GraphiQLConfig
fn clone(&self) -> GraphiQLConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphiQLConfig
impl Debug for GraphiQLConfig
Source§impl Default for GraphiQLConfig
impl Default for GraphiQLConfig
Source§fn default() -> GraphiQLConfig
fn default() -> GraphiQLConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GraphiQLConfig
impl RefUnwindSafe for GraphiQLConfig
impl Send for GraphiQLConfig
impl Sync for GraphiQLConfig
impl Unpin for GraphiQLConfig
impl UnwindSafe for GraphiQLConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)