补充注释
This commit is contained in:
@@ -95,6 +95,7 @@ func NewSchema(config Config) (graphql.Schema, error) {
|
||||
"users": &graphql.Field{
|
||||
Type: graphql.NewObject(graphql.ObjectConfig{
|
||||
Name: "UserConnection",
|
||||
Description: "条件筛选用户列表",
|
||||
Fields: graphql.Fields{
|
||||
"list": &graphql.Field{Type: graphql.NewList(user), Description: "用户列表"},
|
||||
"total": &graphql.Field{Type: graphql.Int, Description: "用户总数"},
|
||||
@@ -169,6 +170,7 @@ func NewSchema(config Config) (graphql.Schema, error) {
|
||||
"images": &graphql.Field{
|
||||
Type: graphql.NewObject(graphql.ObjectConfig{
|
||||
Name: "ImageConnection",
|
||||
Description: "条件筛选图像列表",
|
||||
Fields: graphql.Fields{
|
||||
"list": &graphql.Field{Type: graphql.NewList(image), Description: "图像列表"},
|
||||
"total": &graphql.Field{Type: graphql.Int, Description: "图像总数"},
|
||||
@@ -350,6 +352,7 @@ func NewSchema(config Config) (graphql.Schema, error) {
|
||||
"articles": &graphql.Field{
|
||||
Type: graphql.NewObject(graphql.ObjectConfig{
|
||||
Name: "ArticleConnection",
|
||||
Description: "条件筛选文章列表",
|
||||
Fields: graphql.Fields{
|
||||
"list": &graphql.Field{Type: graphql.NewList(article), Description: "文章列表"},
|
||||
"total": &graphql.Field{Type: graphql.Int, Description: "文章总数"},
|
||||
@@ -416,15 +419,17 @@ func NewSchema(config Config) (graphql.Schema, error) {
|
||||
"tags": &graphql.Field{
|
||||
Type: graphql.NewObject(graphql.ObjectConfig{
|
||||
Name: "TagConnection",
|
||||
Description: "条件筛选标签列表",
|
||||
Fields: graphql.Fields{
|
||||
"list": &graphql.Field{Type: graphql.NewList(graphql.String)},
|
||||
"total": &graphql.Field{Type: graphql.Int},
|
||||
"list": &graphql.Field{Type: graphql.NewList(graphql.String), Description: "标签列表"},
|
||||
"total": &graphql.Field{Type: graphql.Int, Description: "标签总数"},
|
||||
},
|
||||
}),
|
||||
Args: graphql.FieldConfigArgument{
|
||||
"first": &graphql.ArgumentConfig{Type: graphql.Int, DefaultValue: 10},
|
||||
"after": &graphql.ArgumentConfig{Type: graphql.String, DefaultValue: "0"},
|
||||
"before": &graphql.ArgumentConfig{Type: graphql.String},
|
||||
"first": &graphql.ArgumentConfig{Type: graphql.Int, Description: "翻页参数(傳回清單中的前n個元素)"},
|
||||
"last": &graphql.ArgumentConfig{Type: graphql.Int, Description: "翻页参数(傳回清單中的最後n個元素)"},
|
||||
"after": &graphql.ArgumentConfig{Type: graphql.String, Description: "翻页参数(傳回清單中指定遊標之後的元素)"},
|
||||
"before": &graphql.ArgumentConfig{Type: graphql.String, Description: "翻页参数(傳回清單中指定遊標之前的元素)"},
|
||||
},
|
||||
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
|
||||
var tags []string
|
||||
|
Reference in New Issue
Block a user