Struct graphql_client::Response [−][src]
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
impl<Data: Debug> Debug for Response<Data>
[src]
impl<Data: Debug> Debug for Response<Data>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<Data: PartialEq> PartialEq for Response<Data>
[src]
impl<Data: PartialEq> PartialEq for Response<Data>