public ArticleMutation(IWriteArticleService writeArticleService) { _writeArticleService = writeArticleService; Field <ArticleType>( "addArticle", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <CreateArticleInputType> >() { Name = "article" } ), resolve: context => { var article = context.GetArgument <CreateArticleModel>("article"); return(_writeArticleService.Create(article)); }); RegisterDelete(); }
public async Task <ArticleModel> CreateArticle(CreateArticleModel model) { var result = await _writeArticleService.Create(model); return(result); }