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> {
8484 #module_visibility mod #module_name {
8585 #![ allow( dead_code) ]
8686
87+ use std:: result:: Result ;
88+
8789 pub const OPERATION_NAME : & ' static str = #operation_name;
8890 pub const QUERY : & ' static str = #query_string;
8991
Original file line number Diff line number Diff line change @@ -172,10 +172,9 @@ fn create_roots(
172172 graphql_parser:: query:: Definition :: Operation (
173173 graphql_parser:: query:: OperationDefinition :: SelectionSet ( _) ,
174174 ) => {
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+ ) )
179178 }
180179 }
181180 }
@@ -406,9 +405,10 @@ fn resolve_operation(
406405 match operation {
407406 graphql_parser:: query:: OperationDefinition :: Mutation ( m) => {
408407 let on = schema. mutation_type ( ) . ok_or_else ( || {
409- QueryValidationError :: new ( format ! (
408+ QueryValidationError :: new (
410409 "Query contains a mutation operation, but the schema has no mutation type."
411- ) )
410+ . to_owned ( ) ,
411+ )
412412 } ) ?;
413413 let on = schema. get_object ( on) ;
414414
You can’t perform that action at this time.
0 commit comments