File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,18 @@ fn build_graphql_client_derive_options(input: &syn::DeriveInput) -> GraphQLClien
42
42
// The user can determine what to do about deprecations.
43
43
let deprecation_strategy = deprecation:: extract_deprecation_strategy ( input) . unwrap_or_default ( ) ;
44
44
45
+ let selected_operation_name = attributes:: extract_attr ( input, "selected_operation" )
46
+ . context ( "Extracting selected operation name" ) ;
47
+ let selected_operation_name = if selected_operation_name. is_ok ( ) {
48
+ Some ( selected_operation_name. unwrap ( ) )
49
+ } else {
50
+ Some ( input. ident . to_string ( ) )
51
+ } ;
52
+
45
53
GraphQLClientDeriveOptions {
46
- struct_name : input. ident . to_string ( ) ,
54
+ operation_name : selected_operation_name,
55
+ struct_name : Some ( input. ident . to_string ( ) ) ,
56
+ module_name : Some ( input. ident . to_string ( ) ) ,
47
57
additional_derives : response_derives,
48
58
deprecation_strategy : Some ( deprecation_strategy) ,
49
59
}
You can’t perform that action at this time.
0 commit comments