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

Function getLoginInput

graphql/admin/login.go:59–79  ·  view source on GitHub ↗
(m schema.Mutation)

Source from the content-addressed store, hash-verified

57}
58
59func getLoginInput(m schema.Mutation) *loginInput {
60 // We should be able to convert these to string as GraphQL schema validation should ensure this.
61 // If the input wasn't specified, then the arg value would be nil and the string value empty.
62
63 var input loginInput
64
65 input.UserId, _ = m.ArgValue("userId").(string)
66 input.Password, _ = m.ArgValue("password").(string)
67 input.RefreshToken, _ = m.ArgValue("refreshToken").(string)
68
69 b, err := json.Marshal(m.ArgValue("namespace"))
70 if err != nil {
71 return nil
72 }
73
74 err = json.Unmarshal(b, &input.Namespace)
75 if err != nil {
76 return nil
77 }
78 return &input
79}

Callers 1

resolveLoginFunction · 0.85

Calls 1

ArgValueMethod · 0.65

Tested by

no test coverage detected