Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Raise an exception when graphene type is not found

Artur Smęt1b1389f07c40
diff --git a/saleor/graphql/core/mutations.py b/saleor/graphql/core/mutations.py
index 31f956a7bf..87e799e68e 100644
--- a/saleor/graphql/core/mutations.py
+++ b/saleor/graphql/core/mutations.py
@@ -28,6 +28,9 @@ def get_model_name(model):
def get_output_fields(model, return_field_name):
"""Return mutation output field for model instance."""
model_type = registry.get_type_for_model(model)
+ if not model_type:
+ raise ImproperlyConfigured(
+ 'Unable to find type for model %s in graphene registry' % model.__name__)
fields = {return_field_name: graphene.Field(model_type)}
return fields