Struct graphql_client::Response [−][src]
Expand description
The generic shape taken by the responses of GraphQL APIs.
This will generally be used with the ResponseData
struct from a derived module.
use graphql_client::Response; let body: Response<ResponseData> = serde_json::from_value(json!({ "data": { "users": [{"id": 13}], "dogs": [{"name": "Strelka"}], }, "errors": [], }))?; let expected: Response<ResponseData> = Response { data: Some(ResponseData { users: vec![User { id: 13 }], dogs: vec![Dog { name: "Strelka".to_owned() }], }), errors: Some(vec![]), }; assert_eq!(body, expected);
Fields
data: Option<Data>
The absent, partial or complete response data.
errors: Option<Vec<Error>>
The top-level errors returned by the server.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<Data> RefUnwindSafe for Response<Data> where
Data: RefUnwindSafe,
impl<Data> UnwindSafe for Response<Data> where
Data: UnwindSafe,