pub struct Builder;Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new(operation: OperationType, selection_set: &SelectionSet) -> String
pub fn new(operation: OperationType, selection_set: &SelectionSet) -> String
Examples found in repository?
examples/simple-operation.rs (line 24)
3pub fn query() -> String {
4 let story = SelectionSet {
5 operation: "Story",
6 alias: None,
7 fields: Some(vec![SelectionSet {
8 operation: "likeCount",
9 alias: None,
10 fields: None,
11 arguments: None,
12 is_union: false,
13 }]),
14 arguments: None,
15 is_union: false,
16 };
17 let like_story = SelectionSet {
18 operation: "likeStory",
19 alias: None,
20 fields: Some(vec![story]),
21 arguments: json!({ "storyID": 12345 }),
22 is_union: false,
23 };
24 Builder::new(OperationType::Mutation, &like_story)
25}More examples
examples/field-alias.rs (line 41)
3pub fn query() -> String {
4 let vec = vec![
5 SelectionSet {
6 operation: "id",
7 alias: None,
8 fields: None,
9 arguments: None,
10 is_union: false,
11 },
12 SelectionSet {
13 operation: "name",
14 alias: None,
15 fields: None,
16 arguments: None,
17 is_union: false,
18 },
19 SelectionSet {
20 operation: "profilePic",
21 alias: Some("smallPic"),
22 fields: None,
23 arguments: None,
24 is_union: false,
25 },
26 SelectionSet {
27 operation: "profilePic",
28 alias: Some("bigPic"),
29 fields: None,
30 arguments: None,
31 is_union: false,
32 },
33 ];
34 let user = SelectionSet {
35 operation: "user",
36 alias: None,
37 fields: Some(vec),
38 arguments: json!({ "id": 4 }),
39 is_union: false,
40 };
41 Builder::new(OperationType::Query, &user)
42}Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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