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"))
         );
 }
Beispiel #2
0
 public TrainingPlan Get(string name) => _trainingPlanService.Get(name);