Skip to content

Commit 946878d

Browse files
committed
Test operationName on queries with selected_operation attribute
1 parent fc089b5 commit 946878d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

graphql_client/tests/operation_selection.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ fn operation_name_is_correct() {
103103
let echo_variables = echo::Variables {
104104
msg: Some("hi".to_string()),
105105
};
106+
let selected_operation_variables = selected_operation::Variables {
107+
msg: Some("hi".to_string()),
108+
};
106109

107110
let height_variables = heights::Variables {
108111
building_id: "12".to_string(),
@@ -114,12 +117,19 @@ fn operation_name_is_correct() {
114117
};
115118

116119
assert_eq!(Echo::build_query(echo_variables).operation_name, "Echo");
120+
117121
assert_eq!(
118122
Heights::build_query(height_variables).operation_name,
119123
"Heights"
120124
);
125+
121126
assert_eq!(
122127
Unrelated::build_query(unrelated_variables).operation_name,
123128
"Heights"
124129
);
130+
131+
assert_eq!(
132+
SelectedOperation::build_query(selected_operation_variables).operation_name,
133+
"Echo"
134+
);
125135
}

0 commit comments

Comments
 (0)