pub struct GQLClient { /* private fields */ }Implementations§
Source§impl GQLClient
impl GQLClient
pub fn new(endpoint: impl AsRef<str>) -> Self
pub fn new_with_headers( endpoint: impl AsRef<str>, headers: HashMap<impl ToString, impl ToString>, ) -> Self
pub fn new_with_config(config: ClientConfig) -> Self
Source§impl GQLClient
impl GQLClient
pub async fn query<K>(&self, query: &str) -> Result<Option<K>, GraphQLError>where
K: for<'de> Deserialize<'de>,
pub async fn query_unwrap<K>(&self, query: &str) -> Result<K, GraphQLError>where
K: for<'de> Deserialize<'de>,
pub async fn query_with_vars_unwrap<K, T: Serialize>(
&self,
query: &str,
variables: T,
) -> Result<K, GraphQLError>where
K: for<'de> Deserialize<'de>,
pub async fn query_with_vars<K, T: Serialize>(
&self,
query: &str,
variables: T,
) -> Result<Option<K>, GraphQLError>where
K: for<'de> Deserialize<'de>,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GQLClient
impl RefUnwindSafe for GQLClient
impl Send for GQLClient
impl Sync for GQLClient
impl Unpin for GQLClient
impl UnwindSafe for GQLClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more