diff --git a/backend/app/Savor22b/GraphTypes/Query/Query.cs b/backend/app/Savor22b/GraphTypes/Query/Query.cs index b8c478f1..1c77ff6b 100644 --- a/backend/app/Savor22b/GraphTypes/Query/Query.cs +++ b/backend/app/Savor22b/GraphTypes/Query/Query.cs @@ -537,6 +537,7 @@ private List combineRecipeData() { var foodDict = CsvDataHelper.GetFoodCSVData().ToDictionary(x => x.ID); var ingredientDict = CsvDataHelper.GetIngredientCSVData().ToDictionary(x => x.ID); + var kitchenEquipmentCategoryDict = CsvDataHelper.GetKitchenEquipmentCategoryCSVData().ToDictionary(x => x.ID); var recipes = new List(); foreach (var recipe in CsvDataHelper.GetRecipeCSVData()) @@ -550,12 +551,18 @@ private List combineRecipeData() var recipeFoodComponents = recipe.FoodIDList .Select(foodID => new RecipeComponent(foodID, foodDict[foodID].Name)) .ToList(); + var requiredKitchenEquipmentCategoryComponents = recipe.RequiredKitchenEquipmentCategoryList + .Select(equipment => new RecipeComponent(equipment, kitchenEquipmentCategoryDict[equipment].Name)) + .ToList(); + var resultFoodComponent = new RecipeComponent(recipe.ResultFoodID, foodDict[recipe.ResultFoodID].Name); recipes.Add( new RecipeResponse( recipe.ID, recipe.Name, recipe.RequiredBlock, + resultFoodComponent, + requiredKitchenEquipmentCategoryComponents, recipeIngredientComponents, recipeFoodComponents ) diff --git a/backend/app/Savor22b/GraphTypes/Types/RecipeGraphType.cs b/backend/app/Savor22b/GraphTypes/Types/RecipeGraphType.cs index b13f70b7..18c876d5 100644 --- a/backend/app/Savor22b/GraphTypes/Types/RecipeGraphType.cs +++ b/backend/app/Savor22b/GraphTypes/Types/RecipeGraphType.cs @@ -23,12 +23,24 @@ public RecipeResponseType() resolve: context => context.Source.Name ); + Field( + name: "resultFood", + description: "The Result Food of the recipe.", + resolve: context => context.Source.ResultFood + ); + Field( - name: "required", + name: "requiredBlockCount", description: "The RequiredBlock of the recipe.", resolve: context => context.Source.RequiredBlock ); + Field>( + name: "requiredKitchenEquipmentCategoryList", + description: "The list of ingredients in the recipe.", + resolve: context => context.Source.RequiredKitchenEquipmentCategoryList.ToList() + ); + Field>( name: "ingredientIDList", description: "The list of ingredients in the recipe.", diff --git a/backend/app/Savor22b/GraphTypes/Types/RecipeResponse.cs b/backend/app/Savor22b/GraphTypes/Types/RecipeResponse.cs index 2a004fd2..d906d11c 100644 --- a/backend/app/Savor22b/GraphTypes/Types/RecipeResponse.cs +++ b/backend/app/Savor22b/GraphTypes/Types/RecipeResponse.cs @@ -6,6 +6,8 @@ public RecipeResponse( int id, string name, int requiredBlock, + RecipeComponent resultFood, + List requiredKitchenEquipmentCategoryList, List ingredientList, List foodList ) @@ -13,6 +15,8 @@ List foodList Id = id; Name = name; RequiredBlock = requiredBlock; + ResultFood = resultFood; + RequiredKitchenEquipmentCategoryList = requiredKitchenEquipmentCategoryList; IngredientList = ingredientList; FoodList = foodList; } @@ -23,6 +27,10 @@ List foodList public int RequiredBlock { get; set; } + public RecipeComponent ResultFood { get; set; } + + public List RequiredKitchenEquipmentCategoryList { get; set; } + public List IngredientList { get; set; } public List FoodList { get; set; }