//Query的ObjectType public MenuQuery(IMealService mealService, IDrinksService drinksService) { //查詢所有餐點 Field <ListGraphType <MealType> >("meal", resolve: context => mealService.GetAllMeals()); Field <ListGraphType <DrinksType> > ("drink", resolve: context => drinksService.GetAllDrinks()); }
public async Task <IActionResult> Get() { return(Ok(await _mealService.GetAllMeals())); }