diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Schemas/GraphQLSchema.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Schemas/GraphQLSchema.inc index 2662cbcb..ae76bc2d 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Schemas/GraphQLSchema.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Schemas/GraphQLSchema.inc @@ -216,7 +216,12 @@ class GraphQLSchema extends Schema { foreach ($model->get_fields() as $field) { # For NestedModelFields, ensure we pass the Type for the nested Model if ($model->$field instanceof NestedModelField) { - $nested_model_type = $this->get_model_input_object_type($model->$field->model_class); + if ($input) { + $nested_model_type = $this->get_model_input_object_type($model->$field->model_class); + } + else { + $nested_model_type = $this->get_model_object_type($model->$field->model_class); + } $fields[$field]['type'] = $this->field_to_type(field: $model->$field, type: $nested_model_type); $fields[$field]['description'] = $model->$field->help_text; continue;