Skip to content

How to define **{Create,Delete,Update}Args? #516

Answered by flybayer
e-jigsaw asked this question in General
Discussion options

You must be logged in to vote

Good question!

Short answer: you don't have to define any of those types. Those types are automatically defined by Prisma.

Long answer: The contents of db.ts is:

import {PrismaClient} from '@prisma/client'
export * from '@prisma/client'

const prisma = new PrismaClient()

export default prisma

Notice the export * from '@prisma/client' line. That line exports all of types defined by Prisma, including the *{Create,Delete,Update}Args types.

You can see all the Prisma type definitions by opening node_modules/.prisma/client/index.d.ts

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@e-jigsaw
Comment options

@flybayer
Comment options

Answer selected by flybayer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants