(ctx context.Context, m schema.Mutation)
| 25 | } |
| 26 | |
| 27 | func resolveRemoveNode(ctx context.Context, m schema.Mutation) (*resolve.Resolved, bool) { |
| 28 | input, err := getRemoveNodeInput(m) |
| 29 | if err != nil { |
| 30 | return resolve.EmptyResult(m, err), false |
| 31 | } |
| 32 | |
| 33 | if _, err = worker.RemoveNodeOverNetwork(ctx, &pb.RemoveNodeRequest{NodeId: input.NodeId, |
| 34 | GroupId: input.GroupId}); err != nil { |
| 35 | return resolve.EmptyResult(m, err), false |
| 36 | } |
| 37 | |
| 38 | return resolve.DataResult(m, |
| 39 | map[string]interface{}{m.Name(): response("Success", |
| 40 | fmt.Sprintf("Removed node with group: %v, idx: %v", input.GroupId, input.NodeId))}, |
| 41 | nil, |
| 42 | ), true |
| 43 | } |
| 44 | |
| 45 | func getRemoveNodeInput(m schema.Mutation) (*removeNodeInput, error) { |
| 46 | inputArg, ok := m.ArgValue(schema.InputArgName).(map[string]interface{}) |
nothing calls this directly
no test coverage detected