public TrainingPlanQuery(ITrainingPlanService trainingPlanService)
 {
     Field <ListGraphType <TrainingPlanType> >(
         "plans",
         resolve: context => trainingPlanService.GetAll()
         );
     Field <TrainingPlanType>(
         "plan",
         arguments: new QueryArguments(
             new QueryArgument <NonNullGraphType <StringGraphType> > {
         Name = "name", Description = "Name of the training plan"
     }
             ),
         resolve: context => trainingPlanService.Get(context.GetArgument <string>("name"))
         );
 }
Esempio n. 2
0
 public IEnumerable <string> Get() => _trainingPlanService.GetAll().Select(x => x.Name);