在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mkmarek/graphql-dotnetcore开源软件地址(OpenSource Url):https://github.com/mkmarek/graphql-dotnetcore开源编程语言(OpenSource Language):C# 100.0%开源软件介绍(OpenSource Introduction):Library for creating GraphQL servers with .NET core. Code Examplepublic class Query : GraphQLObjectType
{
public Query() : base("Query", "Root query defintion")
{
this.Field("sum", (int[] numbers) => numbers.Sum());
}
}
public class MyAwesomeSchema : GraphQLSchema
{
public MyAwesomeSchema()
{
var rootQuery = new Query();
this.AddKnownType(rootQuery);
this.Query(rootQuery);
}
}
[Route("api/[controller]")]
public class GraphQLController : Controller
{
private MyAwesomeSchema schema = new MyAwesomeSchema();
[HttpPost]
public JsonResult Post(string query)
{
return this.Json(
new
{
data = this.schema.Execute(query)
}
);
}
} Query{
sum(numbers: [1,2,3])
} Result{
"sum" : 6
} Interested? Have a look on a better example here! Documentation
ContributionsWanna contribute? Awesome! Please follow this process to get your feature or bugfix in place. Fork itClone it
Do it
Squash it
More info about squashing http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html. Push it
Request itThe final step will be creating a pull request. Refer the github docs for more details about that https://help.github.com/articles/using-pull-requests/ |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论