コード例 #1
0
        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();
        }
コード例 #2
0
        public async Task <ArticleModel> CreateArticle(CreateArticleModel model)
        {
            var result = await _writeArticleService.Create(model);

            return(result);
        }