Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Consider case when no nodes were found
akjanik9c097434f2a5
diff --git a/saleor/graphql/utils.py b/saleor/graphql/utils.pyindex 8984681ba0..d39336f371 100644--- a/saleor/graphql/utils.py+++ b/saleor/graphql/utils.py@@ -23,7 +23,12 @@ def get_nodes(ids, graphene_type):assert str(graphene_type) == _type, ('Must receive an {} id.').format(graphene_type._meta.name)pks.append(_id)- return graphene_type._meta.model.objects.filter(pk__in=pks)+ nodes = graphene_type._meta.model.objects.filter(pk__in=pks)+ if not nodes:+ raise Exception(+ "Could not resolve to a nodes with the global id list of '%s'."+ % ids)+ return nodesdef get_attributes_dict_from_list(attributes, attr_slug_id):