Skip to content

Commit

Permalink
fix(client): middleware not being passed unpacker (#4959)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamluke4 committed Jan 12, 2021
1 parent 8d7a8a4 commit d02909b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Expand Up @@ -52,3 +52,13 @@ test('middlewares', async () => {

db.$disconnect()
})

test('middlewares unpack', async () => {
const PrismaClient = await getTestClient()
const db = new PrismaClient()
db.$use((params, next) => next(params))
const result = await db.user.count()
expect(typeof result).toBe('number')

db.$disconnect()
})
2 changes: 2 additions & 0 deletions src/packages/client/src/runtime/getPrismaClient.ts
Expand Up @@ -963,6 +963,8 @@ new PrismaClient({
middlewares,
clientMethod,
callsite,
headers,
unpacker
),
)
}
Expand Down

0 comments on commit d02909b

Please sign in to comment.