Hi, I'm using nexus & the prisma 2 plugin - I'...
# graphql-nexus
o
Hi, I'm using nexus & the prisma 2 plugin - I'm wondering if it's possible to access the contents of
schema.prisma
from nexus to programmatically expose my types. Specifically, if I have the following in `schema.prisma`:
Copy code
model Person {
  name String
  age Int
}
I would like to construct the following javascript object:
Copy code
{
  name: "String",
  age: "Int"
}
Thanks!
r
@Oliver Evans 👋 If you have a model
User
like this:
Copy code
model User {
  id   Int    @id @default(autoincrement())
  name String
  age  String
}
You can import its type from the generated PrismaClient.
Copy code
import type { User } from '@prisma/client'
And use this in your app.
o
I'm baffled that it wasn't obvious to me how to do that... Thanks @Ryan 🤦
💯 1