File tree Expand file tree Collapse file tree
pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Schemas Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -216,7 +216,12 @@ class GraphQLSchema extends Schema {
216216 foreach ($ model ->get_fields () as $ field ) {
217217 # For NestedModelFields, ensure we pass the Type for the nested Model
218218 if ($ model ->$ field instanceof NestedModelField) {
219- $ nested_model_type = $ this ->get_model_input_object_type ($ model ->$ field ->model_class );
219+ if ($ input ) {
220+ $ nested_model_type = $ this ->get_model_input_object_type ($ model ->$ field ->model_class );
221+ }
222+ else {
223+ $ nested_model_type = $ this ->get_model_object_type ($ model ->$ field ->model_class );
224+ }
220225 $ fields [$ field ]['type ' ] = $ this ->field_to_type (field: $ model ->$ field , type: $ nested_model_type );
221226 $ fields [$ field ]['description ' ] = $ model ->$ field ->help_text ;
222227 continue ;
You can’t perform that action at this time.
0 commit comments