MCPcopy
hub / github.com/dgraph-io/dgraph / resolveResetPassword

Function resolveResetPassword

graphql/admin/reset_password.go:20–41  ·  view source on GitHub ↗
(ctx context.Context, m schema.Mutation)

Source from the content-addressed store, hash-verified

18)
19
20func resolveResetPassword(ctx context.Context, m schema.Mutation) (*resolve.Resolved, bool) {
21 inp, err := getPasswordInput(m)
22 if err != nil {
23 glog.Error("Failed to parse the reset password input")
24 }
25 if err = (&edgraph.Server{}).ResetPassword(ctx, inp); err != nil {
26 return resolve.EmptyResult(m, err), false
27 }
28
29 return resolve.DataResult(
30 m,
31 map[string]interface{}{
32 m.Name(): map[string]interface{}{
33 "userId": inp.UserID,
34 "message": "Reset password is successful",
35 "namespace": json.Number(strconv.Itoa(int(inp.Namespace))),
36 },
37 },
38 nil,
39 ), true
40
41}
42
43func getPasswordInput(m schema.Mutation) (*edgraph.ResetPasswordInput, error) {
44 var input edgraph.ResetPasswordInput

Callers

nothing calls this directly

Calls 7

EmptyResultFunction · 0.92
DataResultFunction · 0.92
getPasswordInputFunction · 0.85
NameMethod · 0.65
ErrorMethod · 0.45
ResetPasswordMethod · 0.45
NumberMethod · 0.45

Tested by

no test coverage detected