Skip to content

Commit 7008e9b

Browse files
committed
fix: docs: 140-shared-extensions.mdx: fix example
The description of the example did not match the example
1 parent 3461f22 commit 7008e9b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

content/200-orm/200-prisma-client/300-client-extensions/140-shared-extensions.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ To import the `find-or-create` extension from the example above, and wrap your c
3030
```ts
3131
import findOrCreate from 'prisma-extension-find-or-create'
3232

33-
const prisma = new PrismaClient().$extends(findOrCreate)
34-
const user = await prisma.user.findOrCreate()
33+
const prisma = new PrismaClient()
34+
const xprisma = prisma.$extends(findOrCreate)
35+
const user = await xprisma.user.findOrCreate()
3536
```
3637

3738
When you call a method in an extension, use the constant name from your `$extends` statement, not `prisma`. In the above example,`xprisma.user.findOrCreate` works, but `prisma.user.findOrCreate` does not, because the original `prisma` is not modified.

0 commit comments

Comments
 (0)