Skip to content

Commit d79941c

Browse files
committed
Document structs in selection.rs
1 parent 30e9ae6 commit d79941c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graphql_client_codegen/src/selection.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
use constants::*;
22
use graphql_parser::query::SelectionSet;
33

4+
/// A single object field as part of a selection.
45
#[derive(Clone, Debug, PartialEq)]
56
pub struct SelectionField {
67
pub alias: Option<String>,
78
pub name: String,
89
pub fields: Selection,
910
}
1011

12+
/// A spread fragment in a selection (e.g. `...MyFragment`).
1113
#[derive(Clone, Debug, PartialEq)]
1214
pub struct SelectionFragmentSpread {
1315
pub fragment_name: String,
1416
}
1517

18+
/// An inline fragment as part of a selection (e.g. `...on MyThing { name }`).
1619
#[derive(Clone, Debug, PartialEq)]
1720
pub struct SelectionInlineFragment {
1821
pub on: String,
1922
pub fields: Selection,
2023
}
2124

25+
/// An element in a query selection.
2226
#[derive(Clone, Debug, PartialEq)]
2327
pub enum SelectionItem {
2428
Field(SelectionField),
@@ -124,7 +128,7 @@ mod tests {
124128
}
125129

126130
#[test]
127-
fn selection_extract_typename_in_fragemnt() {
131+
fn selection_extract_typename_in_fragment() {
128132
let mut selection = Selection::new_empty();
129133
selection
130134
.0

0 commit comments

Comments
 (0)