public IEnumerable <Ad> Get(int userId, string type = "")
 {
     if (string.IsNullOrWhiteSpace(type))
     {
         return(_favoritesService.RetrieveFavoritedAds(userId, "All"));
     }
     return(_favoritesService.RetrieveFavoritedAds(userId, type));
 }
        public FavoritesQuery(IFavoritesService favoritesService)
        {
            Field <ListGraphType <AdType> >(
                "favs",
                arguments: new QueryArguments(
                    new QueryArgument <IntGraphType> {
                Name = "userId", Description = "User Id"
            }
                    ),
                resolve: context =>
            {
                var userId = context.GetArgument <int>("userId");
                return(favoritesService.RetrieveFavoritedAds(userId).ToList());
            }
                );
            Field <ListGraphType <AdType> >(
                "manualFavs",
                arguments: new QueryArguments(
                    new QueryArgument <IntGraphType> {
                Name = "userId", Description = "User Id"
            }
                    ),
                resolve: context =>
            {
                var userId = context.GetArgument <int>("userId");

                return(favoritesService.RetrieveFavoritedAds(userId, SaveTypes.Manual).ToList());
            }
                );
            Field <ListGraphType <AdType> >(
                "automaticFavs",
                arguments: new QueryArguments(
                    new QueryArgument <IntGraphType> {
                Name = "userId", Description = "User Id"
            }
                    ),
                resolve: context =>
            {
                var userId = context.GetArgument <int>("userId");

                return(favoritesService.RetrieveFavoritedAds(userId, SaveTypes.Automatic).ToList());
            }
                );
        }