移除next

This commit is contained in:
2023-12-07 15:22:26 +08:00
parent bac22ff47a
commit b4ce9846bf

View File

@@ -96,7 +96,6 @@ func NewSchema(config Config) (graphql.Schema, error) {
Name: "UserConnection",
Fields: graphql.Fields{
"list": &graphql.Field{Type: graphql.NewList(user)},
"next": &graphql.Field{Type: graphql.String},
"total": &graphql.Field{Type: graphql.Int},
},
}),
@@ -160,7 +159,7 @@ func NewSchema(config Config) (graphql.Schema, error) {
}
return map[string]interface{}{
"list": users,
"next": true,
"total": 0,
}, nil
},
},
@@ -169,7 +168,6 @@ func NewSchema(config Config) (graphql.Schema, error) {
Name: "ImageConnection",
Fields: graphql.Fields{
"list": &graphql.Field{Type: graphql.NewList(image)},
"next": &graphql.Field{Type: graphql.String},
"total": &graphql.Field{Type: graphql.Int},
},
}),
@@ -227,8 +225,8 @@ func NewSchema(config Config) (graphql.Schema, error) {
}
}
}
case "next":
fmt.Println("next")
case "total":
fmt.Println("total")
default:
fmt.Println(fieldAST.Name.Value)
}
@@ -297,7 +295,6 @@ func NewSchema(config Config) (graphql.Schema, error) {
if id_list_str == "" {
return map[string]interface{}{
"list": []Image{},
"next": false,
"total": 0,
}, nil
}
@@ -348,7 +345,7 @@ func NewSchema(config Config) (graphql.Schema, error) {
return map[string]interface{}{
"list": images,
"next": true,
"total": 0,
}, nil
},
},