(m schema.Mutation)
| 57 | } |
| 58 | |
| 59 | func 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 | } |
no test coverage detected