Hey @andreasqlight 👋 ,

You should be able to import any of Prisma's generated types from the @prisma/client package.

model User {
 ...
}
import type { User } from '@prisma/client'

Let me know if that works!

🌐
Prisma
prisma.io › home › type safety overview › type safety overview › type safety overview
Type safety | Prisma Documentation
The UncheckedInput types are a special set of generated types that allow you to perform some operations that Prisma Client considers "unsafe", like directly writing relation scalar fields.
Discussions

Prisma generate types without pushing changes to database - Stack Overflow
Is there any way to make Prisma to generate all the typescript types without connecting to the database? More on stackoverflow.com
🌐 stackoverflow.com
typescript - How to access prisma generated types? - Stack Overflow
I am using Next.js Prisma NextAuth. I need to access the prisma generated type of one of my tables so that I can extend my NextAuth type from it. My question is, how do you access the types of User... More on stackoverflow.com
🌐 stackoverflow.com
Usage of generated type from Prisma/Client
Hello, I'm trying to leverage as much as possible the generated types from Prisma Client into my typescript app. I have one issue where if I instantiate a new empty object which implements the ... More on github.com
🌐 github.com
2
1
July 20, 2021
how to convert prisma schema to typescript types ?
If you run "prisma generate", you would generate all the ts interfaces based on the prisma schema. You can import those interfaces from "@prisma/client". Example: Prisma Schema: https://ibb.co/P5S53Pj Types generated automatically from the prima Schema: https://ibb.co/QrzbmX8 More on reddit.com
🌐 r/node
5
5
July 6, 2023
🌐
Prisma
prisma.io › home › generators › generators › generators › generators
Generators (Reference) | Prisma Documentation
Provides shared utility types that you should rarely directly need. ... Do not directly import from these files! They are not part of the stable API of the generated code and can change at any time in breaking ways. Usually anything you might need from there is exposed via browser.ts or client.ts under the Prisma namespace.
🌐
Prisma
prisma.io › home › operating against partial structures of your model types › operating against partial structures of your model types › operating against partial structures of your model types › operating against partial structures of your model types
Operating against partial structures of your model types | Prisma Documentation
export type User = { id: string; email: string; name: string | null; }; In some scenarios, you may need a variation of the generated User type. For example, when you have a function that expects an instance of the User model that carries the posts relation.
🌐
npm
npmjs.com › package › @mainamiru › prisma-types-generator
@mainamiru/prisma-types-generator - npm
March 29, 2025 - Prisma is Database ORM Library for Node.js, Typescript. Prisma basically generate each models type definition defined in schema.prisma.
      » npm install @mainamiru/prisma-types-generator
    
Published   Mar 29, 2025
Version   1.1.14
🌐
Medium
medium.com › @jeevankc17 › understanding-typescript-types-with-prisma-e0e41a7d98f3
Understanding TypeScript Types with Prisma | by Jeevan KC | Medium
December 17, 2024 - This guide will walk you through ... of this setup are Prisma models. When you generate your Prisma Client, it generates types based on your schema....
Find elsewhere
🌐
Prisma
prisma.io › typescript
TypeScript ORM with zero-cost type-safety for your database | Prisma
Prisma is an ORM for Node.js and TypeScript that gives you the benefits of type-safety at zero cost by auto-generating types from your database schema.
🌐
Prisma
prisma.io › home › models › models › models › models
Models | Prisma Documentation
When used with TypeScript, Prisma Client provides generated type definitions for your models and any variations of them to make database access entirely type safe.
🌐
Prisma
prisma.io › home › how to use prisma orm's type system › how to use prisma orm's type system › how to use prisma orm's type system › how to use prisma orm's type system
How to use Prisma ORM's type system | Prisma Documentation
Prisma Client provides full type safety for queries, even for partial queries or included relations. This page explains how to leverage the generated types and utilities
🌐
Answer Overflow
answeroverflow.com › m › 1303223598714060892
How to derive a type from types generated by Prisma? - Prisma
November 5, 2024 - Hi, The following TypeScript code snippet is working where I'm able to derive a type `X` from the query result from Prisma. ``` const rows = await prisma.role_users.findMany({ select: { users: { select: { id: true, email: true, }, }, roles: { select: { members: { select: { groups: { select: { id: true, name: true, }, }, }, }, }, }, }, }); type X = (typeof rows)[number]["users"] & { roles: (typeof rows)[number]["roles"]["members"][number]["groups"][]; }; ``` May I know how to create the type outside of the function instead of defining the type `X` on runtime in the function?
🌐
npm
npmjs.com › package › prisma-json-types-generator
prisma-json-types-generator - npm
January 26, 2026 - Supercharge your @prisma/client by adding strong, custom types to Json and String fields. This generator enhances type safety by replacing Prisma's default JsonValue with your own TypeScript types, ensuring data conforms to your schema before it even reaches the database.
      » npm install prisma-json-types-generator
    
Published   Jan 26, 2026
Version   4.1.1
Top answer
1 of 10
103

An alternate method (my preferrence) to get the "full" type, or the model with all of its possible relations, is to use the GetPayload version of your model type. The type is a generic that can receive the same object you pass to your query.

import { PrismaClient, Prisma } from "@prisma/client";

const prisma = new PrismaClient();

type UserWithCars = Prisma.UserGetPayload<{
  include: {
    cars: true;
  }
}>

const usersWithCars = await prisma.user.findMany({
  include: {
    cars: true,
  }
});

As your query grows more complex, you may want to abstract it and ensure that it is strongly typed.

import { Prisma, PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

const userInclude = Prisma.validator<Prisma.UserInclude>()({
  cars: true,
});

type UserWithCars = Prisma.UserGetPayload<{
  include: typeof userInclude;
}>;

const usersWithCars = await prisma.user.findMany({
  include: userInclude,
});

2 of 10
20

You can use the Prisma Validator API along with some typescript features to generate types for your query.

For the findMany example you mentioned

import { Prisma } from '@prisma/client'

// 1. Define a User type that includes the "cars" relation. 
const userWithCars = Prisma.validator<Prisma.UserArgs>()({
    include: { cars: true },
})

// 2: This type will include many users and all their cars
type UserWithCars = Prisma.UserGetPayload<typeof userWithCars>[]

If you simply want to automatically infer the return type of a prisma query wrapped in a function, you can use PromiseReturnType.

For example:

import { Prisma } from '@prisma/client'

async function getUsersWithCars() {
  const users = await prisma.user.findMany({ include: { cars: true } });
  return users;
}

type UsersWithCars = Prisma.PromiseReturnType<typeof getUsersWithCars>

You can read more about this in the Operating against partial structures of your model types concept guide in the Prisma docs.

🌐
DeepWiki
deepwiki.com › arthurfiorette › prisma-json-types-generator › 8.1-generated-type-utilities
Generated Type Utilities | arthurfiorette/prisma-json-types-generator | DeepWiki
November 12, 2025 - These utilities provide type-safe operations for JSON and JSON array fields when using custom types defined in the PrismaJson namespace. For information about typed string filter types (TypedStringFilter, TypedStringNullableFilter, etc.), see Typed String Filters. The generator injects several utility types into the Prisma Client output to enable type-safe operations on JSON fields.
🌐
Stack Overflow
stackoverflow.com › questions › 77984466 › how-do-i-generate-typescript-types-with-prisma
How do I generate Typescript types with Prisma?
type Recipe = { id: string; title: string description: string; // rest of the properties } ... import { Recipe } from '@prisma/client'; const RecipeCard = ({ recipe }: { recipe: Recipe }) => { const nonExistentProperty = recipe.fakeProperty; return <></>; };