codeledge / ra-tools

React Admin Tools, namely the Prisma Data Adapter
66 stars 19 forks source link

defaultHandler should support include and select options for getOne request #31

Closed bradchoate closed 2 years ago

bradchoate commented 2 years ago

I'd like to pass through the include object to identify relational properties to include, but there isn't a getOne options key for defaultHandler.

Also, the 'create' and 'update' method handlers should also support Prisma's include option, to allow propagating relational properties.

bradchoate commented 2 years ago

Ah, I see #32 already addresses this issue.

ogroppo commented 2 years ago

Hi @bradchoate, just published ra-data-simple-prisma@1.1.0 please give it a go and see if it works for you. One thing, since in defaultHandler you cannot pass the Prisma.whateverModelArgs interface as a generic, you won't have the same nice autocomplete of select and include as you would by using getOneHandler<Prisma...findUniqueArgs>

bradchoate commented 2 years ago

Yes, thank you so much!