File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
src/fastcs/backends/graphQL Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -139,17 +139,19 @@ def get_child(self, name: str) -> "FieldsTree":
139139 return child
140140 raise NodeNotFoundError
141141
142- def create_type (self , strawberry_type : str ) -> type :
142+ def create_type (self , strawberry_type : str ) -> type | None :
143143 for child in self .children :
144- child_field = _wrap_as_field (
145- child .name ,
146- child .create_type (strawberry_type ),
147- )
148- self .fields_dict [strawberry_type ].append (child_field )
144+ if new_type := child .create_type (strawberry_type ):
145+ child_field = _wrap_as_field (
146+ child .name ,
147+ new_type ,
148+ )
149+ self .fields_dict [strawberry_type ].append (child_field )
149150
150- return create_type (
151- f"{ self .name } { strawberry_type } " , self .fields_dict [strawberry_type ]
152- )
151+ if self .fields_dict [strawberry_type ]:
152+ return create_type (
153+ f"{ self .name } { strawberry_type } " , self .fields_dict [strawberry_type ]
154+ )
153155
154156
155157def _add_dev_attributes (
You can’t perform that action at this time.
0 commit comments