File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
graphql_client_codegen/src Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ impl<'a> GeneratedModule<'a> {
84
84
#module_visibility mod #module_name {
85
85
#![ allow( dead_code) ]
86
86
87
+ use std:: result:: Result ;
88
+
87
89
pub const OPERATION_NAME : & ' static str = #operation_name;
88
90
pub const QUERY : & ' static str = #query_string;
89
91
Original file line number Diff line number Diff line change @@ -172,10 +172,9 @@ fn create_roots(
172
172
graphql_parser:: query:: Definition :: Operation (
173
173
graphql_parser:: query:: OperationDefinition :: SelectionSet ( _) ,
174
174
) => {
175
- return Err ( QueryValidationError :: new ( format ! (
176
- "{}" ,
177
- crate :: constants:: SELECTION_SET_AT_ROOT
178
- ) ) )
175
+ return Err ( QueryValidationError :: new (
176
+ crate :: constants:: SELECTION_SET_AT_ROOT . to_owned ( ) ,
177
+ ) )
179
178
}
180
179
}
181
180
}
@@ -406,9 +405,10 @@ fn resolve_operation(
406
405
match operation {
407
406
graphql_parser:: query:: OperationDefinition :: Mutation ( m) => {
408
407
let on = schema. mutation_type ( ) . ok_or_else ( || {
409
- QueryValidationError :: new ( format ! (
408
+ QueryValidationError :: new (
410
409
"Query contains a mutation operation, but the schema has no mutation type."
411
- ) )
410
+ . to_owned ( ) ,
411
+ )
412
412
} ) ?;
413
413
let on = schema. get_object ( on) ;
414
414
You can’t perform that action at this time.
0 commit comments