public PhaseType(ISkillLogic skillLogic, IEngagementLogic engagementLogic) { Field(x => x.ProjectID); Field(x => x.DocumentID); Field(x => x.PhaseID); Field(x => x.StartDate); Field(x => x.Name); Field(x => x.Description); Field(x => x.Duration); FieldAsync <ListGraphType <SkillType> >("requiredSkills", resolve: async context => { return(await skillLogic.GetByPhase(context.Source.PhaseID)); }); FieldAsync <ListGraphType <EngagementType> >("engagements", resolve: async context => { return(await engagementLogic.GetByPhase(context.Source.PhaseID)); }); }
public EngagementQuery(IEngagementLogic engagementLogic) { FieldAsync <EngagementType>( "engagementByIds", arguments: new QueryArguments(new QueryArgument <IntGraphType> { Name = "phaseId" }, new QueryArgument <IntGraphType> { Name = "studentId" }), resolve: async context => { return(await engagementLogic.GetById(context.GetArgument <int>("phaseId"), context.GetArgument <int>("studentId"))); } ); FieldAsync <ListGraphType <EngagementType> >( "engagementByPhase", arguments: new QueryArguments(new QueryArgument <IntGraphType> { Name = "phaseId" }), resolve: async context => { return(await engagementLogic.GetByPhase(context.GetArgument <int>("phaseId"))); } ); }