示例#1
0
 public DemoQuery(IEmpInfoService empInfoService,
                  ITeacherService teacherService,
                  ILessonPlanService lessonPlanService)
 {
     Field <ListGraphType <EmpInfoType> >("newEmployees", "当日新入职员工", null, context => empInfoService.GetResolvers(context));
     Field <TeacherType>("teacher", "根据HrCode查询老师信息", teacherService.GetArguments(), context => teacherService.GetResolvers(context));
     Field <ListGraphType <LessonPlanType> >("lessonPlan", "查询教案", lessonPlanService.GetArguments(), context => lessonPlanService.GetResolvers(context));
 }
示例#2
0
        public TeacherType(ILessonPlanService lessonPlanService)
        {
            _lessonPlanService = lessonPlanService;

            Name        = "Teacher";
            Description = "老师(用户)";
            Field(t => t.UserId).Description("用户Id");
            Field(t => t.DisplayName, nullable: true).Description("老师姓名");
            Field(t => t.Grade, nullable: true).Description("年级");
            Field(t => t.WorkLocation).Description("工作地点");
            Field <ListGraphType <LessonPlanType> >(nameof(Teacher.LessonPlans), "老师名下的教案", _lessonPlanService.GetArguments(), context => _lessonPlanService.GetResolvers(context));
        }