(m schema.Mutation)
| 43 | } |
| 44 | |
| 45 | func getRemoveNodeInput(m schema.Mutation) (*removeNodeInput, error) { |
| 46 | inputArg, ok := m.ArgValue(schema.InputArgName).(map[string]interface{}) |
| 47 | if !ok { |
| 48 | return nil, inputArgError(errors.Errorf("can't convert input to map")) |
| 49 | } |
| 50 | |
| 51 | inputRef := &removeNodeInput{} |
| 52 | nodeId, err := parseAsUint64(inputArg["nodeId"]) |
| 53 | if err != nil { |
| 54 | return nil, inputArgError(schema.GQLWrapf(err, "can't convert input.nodeId to uint64")) |
| 55 | } |
| 56 | inputRef.NodeId = nodeId |
| 57 | |
| 58 | gId, err := parseAsUint32(inputArg["groupId"]) |
| 59 | if err != nil { |
| 60 | return nil, inputArgError(schema.GQLWrapf(err, "can't convert input.groupId to uint32")) |
| 61 | } |
| 62 | inputRef.GroupId = gId |
| 63 | |
| 64 | return inputRef, nil |
| 65 | } |
| 66 | |
| 67 | func parseAsUint64(val interface{}) (uint64, error) { |
| 68 | return parseAsUint(val, 64) |
no test coverage detected