Skip to content

Commit

Permalink
fix: properly clone batched queries context
Browse files Browse the repository at this point in the history
  • Loading branch information
drakhart committed Aug 31, 2022
1 parent 7ea5e4a commit e3cc185
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,12 @@ module.exports = async function (app, opts) {

return Promise.all(request.body.map(async (r, operationId) => {
// Create individual reqs for multiple operations, otherwise reference the original req
const operationReq = operationsCount > 1 ? Object.create(request) : request
const operationReq = operationsCount > 1
? {
...request,
[kRequestContext]: Object.create(request[kRequestContext])
}
: request

Object.assign(operationReq[kRequestContext], { operationId })

Expand Down

0 comments on commit e3cc185

Please sign in to comment.