Gruyere cheese is one of the fattest and most caloric cheeses available. It contains about 400 kcal/100g. Therefore, it is not the best preferred choice for losing weight. What we should remember is that, in general, the more a cheese is dry and hard (hence, poor in water), the more it is fat.
In order to lose weight, it is advisable then to focus on low-fat cheese which contains about 10-15% of fat and to only consume the amount allowed in your food plan. However, enjoying some 30g of gruyere cheese occasionally has never hurt anyone!