Пример #1
0
        public HostMutation(HostRepository hostRepo)
        {
            Name = "HostMutation";

            Field <HostGraphType>("modifyStats",
                                  arguments: new QueryArguments(
                                      new QueryArgument <NonNullGraphType <IntGraphType> > {
                Name = "hostId", Description = "host id"
            },
                                      new QueryArgument <ListGraphType <StatsInputGraphType> > {
                Name = "stats", Description = "stats"
            }
                                      ),
                                  resolve: context => {
                var hostId = context.GetArgument <int>("hostId");
                var stats  = context.GetArgument <List <Domain.Stats> >("stats");
                var host   = hostRepo.ModifyStats(hostId, stats);
                return(host);
            })
            .AddQAPermissions();
        }