You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib.rs
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
//!
3
3
//! The main interface to this library is the custom derive that generates modules from a GraphQL query and schema.
4
4
5
+
#![deny(missing_docs)]
6
+
5
7
externcrate serde;
6
8
#[macro_use]
7
9
externcrate serde_derive;
@@ -16,20 +18,27 @@ extern crate serde_json;
16
18
pubuse graphql_query_derive::*;
17
19
18
20
/// A convenience trait that can be used to build a GraphQL request body.
21
+
///
22
+
/// This will be implemented for you by codegen in the normal case.
19
23
pubtraitGraphQLQuery<'de>{
24
+
/// The shape of the variables expected by the query. This should be a generated struct most of the time.
20
25
typeVariables: serde::Serialize;
26
+
/// The top-level shape of the response data (the `data` field in the GraphQL response). In practice this should be generated, since it is hard to write by hand without error.
21
27
typeResponseData: serde::Deserialize<'de>;
22
28
23
29
/// Produce a GraphQL query struct that can be JSON serialized and sent to a GraphQL API.
/// The form in which queries are sent over HTTP in most implemnetations.
27
34
#[derive(Debug,Serialize,Deserialize)]
28
35
pubstructGraphQLQueryBody<Variables>
29
36
where
30
37
Variables: serde::Serialize,
31
38
{
39
+
/// The values for the variables. They must match those declared in the queries. This should be the `Variables` struct from the generated module corresponding to the query.
0 commit comments