2
0
Alexey Kim 2 rokov pred
rodič
commit
0f14313e83
1 zmenil súbory, kde vykonal 8 pridanie a 3 odobranie
  1. 8 3
      graphql/query_product.go

+ 8 - 3
graphql/query_product.go

@@ -279,11 +279,16 @@ func (r *queryResolver) ProductTags(_ context.Context, first int) (*generated.St
 		return nil, err
 	}
 
-	return helper.NewProductTagConnection(tags, &first, nil, nil)
+	return helper.NewStringConnection(tags, &first, nil, nil)
 }
 
-func (r *queryResolver) ProductTypes(ctx context.Context, first int) (*generated.StringConnection, error) {
-	panic("not implemented")
+func (r *queryResolver) ProductTypes(_ context.Context, first int) (*generated.StringConnection, error) {
+	types, err := r.db.ProductTypes()
+	if err != nil {
+		return nil, err
+	}
+
+	return helper.NewStringConnection(types, &first, nil, nil)
 }
 
 func (r *queryResolver) ProductRecommendations(ctx context.Context, productID string) ([]*generated.Product, error) {