Struct async_graphql::http::GraphiQLSource

source ·
pub struct GraphiQLSource<'a> { /* private fields */ }
Expand description

A builder for constructing a GraphiQL (v2) HTML page.

§Example

use async_graphql::http::*;

GraphiQLSource::build()
    .endpoint("/")
    .subscription_endpoint("/ws")
    .header("Authorization", "Bearer [token]")
    .credentials(Credentials::Include)
    .finish();

Implementations§

source§

impl<'a> GraphiQLSource<'a>

source

pub fn build() -> GraphiQLSource<'a>

Creates a builder for constructing a GraphiQL (v2) HTML page.

source

pub fn endpoint(self, endpoint: &'a str) -> GraphiQLSource<'a>

Sets the endpoint of the server GraphiQL will connect to.

source

pub fn subscription_endpoint(self, endpoint: &'a str) -> GraphiQLSource<'a>

Sets the subscription endpoint of the server GraphiQL will connect to.

source

pub fn header(self, name: &'a str, value: &'a str) -> GraphiQLSource<'a>

Sets a header to be sent with requests GraphiQL will send.

source

pub fn title(self, title: &'a str) -> GraphiQLSource<'a>

Sets the html document title.

source

pub fn credentials(self, credentials: Credentials) -> GraphiQLSource<'a>

Sets credentials option for the fetch requests.

source

pub fn plugins(self, plugins: &'a [GraphiQLPlugin<'_>]) -> GraphiQLSource<'a>

Sets plugins

source

pub fn finish(self) -> String

Returns a GraphiQL (v2) HTML page.

Trait Implementations§

source§

impl<'a> Default for GraphiQLSource<'a>

source§

fn default() -> GraphiQLSource<'a>

Returns the “default value” for a type. Read more
source§

impl<'a> Serialize for GraphiQLSource<'a>

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for GraphiQLSource<'a>

§

impl<'a> RefUnwindSafe for GraphiQLSource<'a>

§

impl<'a> Send for GraphiQLSource<'a>

§

impl<'a> Sync for GraphiQLSource<'a>

§

impl<'a> Unpin for GraphiQLSource<'a>

§

impl<'a> UnwindSafe for GraphiQLSource<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.