MichalLytek / typegraphql-prisma

Prisma generator to emit TypeGraphQL types and CRUD resolvers from your Prisma schema
https://prisma.typegraphql.com
MIT License
891 stars 113 forks source link

Use GraphQL Native `ID` type for ids #344

Closed robertt closed 2 years ago

robertt commented 2 years ago

Hey Michał - first of all, thanks for making this library! we've been using it for a new codebase at my company and it's proven excellent.

One issue we've ran into is using Relay with it, specifically complying with the Global Object Identification spec. Something this (and many other specs) require is ids use the native ID type instead of just String (or whatever the type would be). Seeing as you have context on which Prisma fields are ids, either generating it automatically or including an option to use ID makes sense to me.

Would be happy to PR this myself if needed, just making sure this is something you'd be willing/interested in it being implemented.

MichalLytek commented 2 years ago

I think it's just undocumented by accident: https://github.com/MichalLytek/typegraphql-prisma/issues/26

robertt commented 2 years ago

Oh amazing, thanks! Not sure how I didn't find that issue. Will close!