(ctx context.Context, field Field, parents,
args interface{})
| 153 | } |
| 154 | |
| 155 | func GetBodyForLambda(ctx context.Context, field Field, parents, |
| 156 | args interface{}) map[string]interface{} { |
| 157 | accessJWT, _ := x.ExtractJwt(ctx) |
| 158 | body := map[string]interface{}{ |
| 159 | "resolver": field.GetObjectName() + "." + field.Name(), |
| 160 | "X-Dgraph-AccessToken": accessJWT, |
| 161 | "authHeader": map[string]interface{}{ |
| 162 | "key": field.GetAuthMeta().GetHeader(), |
| 163 | "value": authorization.GetJwtToken(ctx), |
| 164 | }, |
| 165 | } |
| 166 | if parents != nil { |
| 167 | body["parents"] = parents |
| 168 | } |
| 169 | if args != nil { |
| 170 | body["args"] = args |
| 171 | } |
| 172 | return body |
| 173 | } |
no test coverage detected