Пример #1
0
 public ProductMutation(IReviewRepo reviewRepo, ReviewMessageService messageService)
 {
     FieldAsync <ReviewGt>(
         "createReview",
         arguments: new QueryArguments(
             new QueryArgument <NonNullGraphType <ReviewInputGt> > {
         Name = "review"
     }),
         resolve: async context =>
     {
         var review = context.GetArgument <Review>("review");
         await reviewRepo.AddAsync(review);
         messageService.AddReviewAddedMessage(review);
         return(review);
     });
 }