public ReportQuery(IReportApplicationDriver reportDriver)
        {
            Name = "ReportQuery";

            #region Report
            Field <ListGraphType <ReportType> >(
                "reportByExamID",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "examID"
            }),
                resolve: context => reportDriver.GetReportByID(context.GetArgument <int>("examID")));

            Field <ListGraphType <ReportType> >(
                "reportByUserID",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "userID"
            },
                                              new QueryArgument <IntGraphType> {
                Name = "examID"
            }),
                resolve: context => reportDriver.GetReportByUserID(context.GetArgument <int>("userID"), context.GetArgument <int>("examID")));



            #endregion
        }
示例#2
0
        public ReportMutation(IReportApplicationDriver reportDriver, ILogger <ReportMutation> logger)
        {
            _reportDriver = reportDriver;
            _logger       = logger;


            Name = "ReportMutation";

            Field <BooleanGraphType>(
                "AddReport",
                arguments: new QueryArguments(new QueryArgument <NonNullGraphType <ReportInputType> > {
                Name = "reportAdd"
            }),
                resolve: context => ManageReport(context, ReportOperations.AddReport));

            Field <BooleanGraphType>(
                "AddReports",
                arguments: new QueryArguments(new QueryArgument <NonNullGraphType <ListGraphType <ReportInputType> > > {
                Name = "reportAdd"
            }),
                resolve: context => ManageReport(context, ReportOperations.AddReports));
        }