MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / getRemoveNodeInput

Function getRemoveNodeInput

graphql/admin/removeNode.go:45–65  ·  view source on GitHub ↗
(m schema.Mutation)

Source from the content-addressed store, hash-verified

43}
44
45func 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
67func parseAsUint64(val interface{}) (uint64, error) {
68 return parseAsUint(val, 64)

Callers 1

resolveRemoveNodeFunction · 0.85

Calls 6

GQLWrapfFunction · 0.92
inputArgErrorFunction · 0.85
parseAsUint64Function · 0.85
parseAsUint32Function · 0.85
ArgValueMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected