MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / getAssignInput

Function getAssignInput

graphql/admin/assign.go:77–96  ·  view source on GitHub ↗
(m schema.Mutation)

Source from the content-addressed store, hash-verified

75}
76
77func getAssignInput(m schema.Mutation) (*assignInput, error) {
78 inputArg, ok := m.ArgValue(schema.InputArgName).(map[string]interface{})
79 if !ok {
80 return nil, inputArgError(errors.Errorf("can't convert input to map"))
81 }
82
83 inputRef := &assignInput{}
84 inputRef.What, ok = inputArg["what"].(string)
85 if !ok {
86 return nil, inputArgError(errors.Errorf("can't convert input.what to string"))
87 }
88
89 num, err := parseAsUint64(inputArg["num"])
90 if err != nil {
91 return nil, inputArgError(schema.GQLWrapf(err, "can't convert input.num to uint64"))
92 }
93 inputRef.Num = num
94
95 return inputRef, nil
96}

Callers 1

resolveAssignFunction · 0.85

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…