[][src]Struct byo_graphql::GraphqlClient

pub struct GraphqlClient { /* fields omitted */ }

A client that you may reuse to do several queries

Implementations

impl GraphqlClient[src]

pub fn new<S: Into<String>>(url: S) -> ByoResult<Self>[src]

create a client

pub fn set_bearer_auth<S: Into<String>>(&mut self, auth: S)[src]

specify the optional authentication token which will be used in all requests

pub fn raw<S: Into<String>>(&self, query: S) -> ByoResult<Response>[src]

return a raw reqwest Response. You should usually not need this function

pub fn text<S: Into<String>>(&self, query: S) -> ByoResult<String>[src]

get the server's answer as unparsed text. This is mainly useful to debug and tune your structures or query

pub fn get_data<S: Into<String>, Data: DeserializeOwned>(
    &self,
    query: S
) -> ByoResult<Data>
[src]

get the data part of the answer in the desired type (it usually looks like a map)

pub fn get_first_item<S: Into<String>, Item: DeserializeOwned>(
    &self,
    query: S
) -> ByoResult<Item>
[src]

get the first item in the answer, if present. This is a convenience method for the simplest case, most especially for when you query a unique item.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.