pub struct QueryBuilder { /* private fields */ }Expand description
Buffered GraphQL request. Serialization/header failures surface when sent.
Implementations§
Source§impl QueryBuilder
impl QueryBuilder
Sourcepub fn variables<T: Serialize + ?Sized>(self, variables: &T) -> Self
pub fn variables<T: Serialize + ?Sized>(self, variables: &T) -> Self
Serialize variables once and retain their raw JSON until request serialization.
Sourcepub fn operation_name(self, name: &str) -> Self
pub fn operation_name(self, name: &str) -> Self
Select an operation in a multi-operation document.
Sourcepub fn header(self, name: &str, value: &str) -> Self
pub fn header(self, name: &str, value: &str) -> Self
Replace a request header. All custom values are treated as sensitive.
Sourcepub fn headers(self, headers: HeaderMap) -> Self
pub fn headers(self, headers: HeaderMap) -> Self
Merge request headers, marking every supplied value sensitive.
Sourcepub async fn send(self) -> Result<Response, GraphqlClientError>
pub async fn send(self) -> Result<Response, GraphqlClientError>
Send and return the raw successful HTTP response, without interpreting execution errors.
§Errors
Returns construction, serialization, transport, or non-2xx HTTP errors.
Sourcepub async fn fetch<T: DeserializeOwned>(
self,
) -> Result<GraphqlResponse<T>, GraphqlClientError>
pub async fn fetch<T: DeserializeOwned>( self, ) -> Result<GraphqlResponse<T>, GraphqlClientError>
Decode typed data and preserve execution errors, including null/partial data.
§Errors
Returns send errors, malformed envelopes, or data decoding errors.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for QueryBuilder
impl !UnwindSafe for QueryBuilder
impl Freeze for QueryBuilder
impl Send for QueryBuilder
impl Sync for QueryBuilder
impl Unpin for QueryBuilder
impl UnsafeUnpin for QueryBuilder
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