Cauen / prisma-generator-pothos-codegen

The fastest way to create a fully customizable CRUD Graphql API from Prisma Schema.
https://www.npmjs.com/package/prisma-generator-pothos-codegen
95 stars 16 forks source link

Generate 'ID' fields in input types #51

Closed hbendev closed 1 year ago

hbendev commented 1 year ago

See https://github.com/Cauen/prisma-generator-pothos-codegen/issues/50

Cauen commented 1 year ago

Thanks for your contribution @hbendev You implemented just for string Ids. Why not for any id?

hbendev commented 1 year ago

Okay, I'll transform integer id fields too. I was strict, because according to the GraphQL specification only integer and string input values should be accepted as IDs.

However, Prisma supports declaring any scalar field as an id, so I'm a little lost on whether this is the most correct solution. https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#id

hbendev commented 1 year ago

Hi @Cauen Can this fix get merged and released? After reading the prisma docs more carefully, all scalars should be allowed. I'll try make that change soon.

hbendev commented 1 year ago

Also, I want to note that this is unfortunately a breaking change.