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

Function GetBodyForLambda

graphql/schema/custom_http.go:155–173  ·  view source on GitHub ↗
(ctx context.Context, field Field, parents,
	args interface{})

Source from the content-addressed store, hash-verified

153}
154
155func 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}

Callers 1

rewriteAndExecuteMethod · 0.92

Calls 6

ExtractJwtFunction · 0.92
GetJwtTokenFunction · 0.92
GetHeaderMethod · 0.80
GetObjectNameMethod · 0.65
NameMethod · 0.65
GetAuthMetaMethod · 0.65

Tested by

no test coverage detected