graphql-go / graphql

An implementation of GraphQL for Go / Golang
MIT License
9.91k stars 839 forks source link

how to delete multiple items with graphql #499

Closed xiaolinziwang closed 5 years ago

xiaolinziwang commented 5 years ago

"delete": &graphql.Field{ Type: graphql.ID, Description: "delete", Args: graphql.FieldConfigArgument{ "instanceIds": &graphql.ArgumentConfig{Type:graphql.NewNonNull(graphql.NewList(graphql.String))}, }, Resolve: func(p graphql.ResolveParams) (i interface{}, e error) { log.Println("Args:", p.Args) instanceIds, := p.Args["instanceIds"].([]interface{}) instanceIdString := make([]string, len(instanceIds)) for , v := range instanceIds { instanceIdString = append(instanceIdString, v.(string)) } log.Println("instanceIdString:",instanceIdString) return "0",nil }, },