aerogear / aerogear/create-graphql

Support raw GraphQL Mutation

オープン
#21 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
help wanted new feature
主要言語
JavaScript
スター
438
フォーク
35
PR マージ指標
30日以内にマージされた PR はありません

説明

Example of raw graphql mutation based on https://learngraphql.com/basics/defining-mutations/2

```jsx
const Mutation = new GraphQLObjectType({
name: "BlogMutations",
description: "Mutations of our blog",
fields: () => ({
createPost: {
type: Post,
args: {
title: {type: new GraphQLNonNull(GraphQLString)},
content: {type: new GraphQLNonNull(GraphQLString)}
},
resolve: function(source, args) {
let post = Object.assign({}, args);
// Generate the _id
post._id = `${Date.now()}::${Math.ceil(Math.random() * 9999999)}`;
// Assign a user
post.author = "arunoda";

// Add the Post to the data store
PostsList.push(post);

// return the new post.
return post;
}
}
})
});
```

I think this could work on apollo as well

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。