Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Use other template tag to get product thumbnail
Marcin Gębala71ba1f3d1ecb
diff --git a/saleor/graphql/api.py b/saleor/graphql/api.pyindex f0c09f4431..3b674340f3 100644--- a/saleor/graphql/api.py+++ b/saleor/graphql/api.py@@ -10,7 +10,7 @@ from graphene_django.debug import DjangoDebugfrom ..product.models import (AttributeChoiceValue, Category, Product,ProductAttribute, ProductImage, ProductVariant)from ..product.utils import get_availability-from ..product.templatetags.product_images import get_thumbnail+from ..product.templatetags.product_images import product_first_imagefrom .scalars import AttributesFilterScalarfrom .utils import (CategoryAncestorsCache, DjangoPkInterface)@@ -49,8 +49,7 @@ class ProductType(DjangoObjectType):interfaces = (relay.Node, DjangoPkInterface)def resolve_thumbnail_url(self, args, context, info):- image_obj = self.images.first()- return get_thumbnail(image_obj.image if image_obj else None, '400x400')+ return product_first_image(self, '400x400')def resolve_images(self, args, context, info):return self.images.all()