paljs / prisma-tools

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

Bug: SDL and resolver generation not consistent for findFirst queries #166

Closed pakatagoh closed 3 years ago

pakatagoh commented 3 years ago

The image below shows the query generated by pal g. The generated query for an Organisation model has findFirstOrganisations return type is an array. image

It's not consistent with the return type of the findFirstOrganisation resolver.

Should the return type be Organisation instead of [Organisation!] ?

See the return type for findFirst here: https://www.prisma.io/docs/concepts/components/prisma-client/crud#return-type-1

Currently using @paljs/cli and @paljs/plugins v2.11.0, prisma/client and @prisma/cli v2.14.0

pakatagoh commented 3 years ago

Potential fix in #167

AhmedElywa commented 3 years ago

Fixed by @pakatagoh

pakatagoh commented 3 years ago

thanks! @AhmedElywa

Do you know when you'll publish a new release with the changes?

AhmedElywa commented 3 years ago

Today, sorry for late.

AhmedElywa commented 3 years ago

V2.11.1 have your fix