Skip to content

Commit

Permalink
fix return type in schema
Browse files Browse the repository at this point in the history
  • Loading branch information
imor committed Nov 23, 2023
1 parent e0e2462 commit 688826b
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 163 deletions.
15 changes: 6 additions & 9 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,12 @@ impl __Schema {
None => __TypeField::PossibleTypes(None),
},
"ofType" => {
let unwrapped_type_builder = match type_ {
let field_type = if let __Type::FuncCallResponse(func_call_resp_type) = type_ {
func_call_resp_type.return_type.deref()
} else {
type_
};
let unwrapped_type_builder = match field_type {
__Type::List(list_type) => {
let inner_type: __Type = (*(list_type.type_)).clone();
Some(self.to_type_builder_from_type(
Expand All @@ -2214,14 +2219,6 @@ impl __Schema {
variables,
)?)
}
__Type::FuncCallResponse(func_call_resp_type) => {
Some(self.to_type_builder_from_type(
&func_call_resp_type.return_type,
selection_field,
fragment_definitions,
variables,
)?)
}
_ => None,
};
__TypeField::OfType(unwrapped_type_builder)
Expand Down
Loading

0 comments on commit 688826b

Please sign in to comment.