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")) ); }
public IEnumerable <string> Get() => _trainingPlanService.GetAll().Select(x => x.Name);