paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
680 stars 55 forks source link

[bug][admin] Admin table not working with no capitalized models #271

Open Cauen opened 2 years ago

Cauen commented 2 years ago

Once models in resolver names are Capitalized on Nexus Generator, we need to Capitalize in requests of Prisma Table

NOTE: This component use 3 queries (findUnique, findMany, findManyCount) and 3 mutations (createOne, updateOne, deleteOne) be sure to add them in your backend by using our CLI pal generate

Now, models are creating this resolvers

Model Resolver Request from AdminTable Ok?
commom_user createOneCommom_user createOnecommom_user
CommomUser createOneCommomUser createOneCommomUser

Ive fixed and sending a PR

AhmedElywa commented 2 years ago

Prisma recommends to type in camel case can you use pal schema camel-case to update your schema with camel case

Cauen commented 2 years ago

Prisma recommends to type in camel case can you use pal schema camel-case to update your schema with camel case

A way to automatically convert to PascalCase is very good But I believe that because it is not a mandatory step before use generator, and the Nexus resolvers is always with capitalized model names, it is still a bug. What do you think?