You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { Webhook } from '@prisma/client'
@Injectable()
export class WebhookService extends PrismaCrudService {
constructor() {
super({
model: Webhook,
allowedJoins: ['tenant', 'file'], // e.g. Error will be thrown when a wrong field is passed in
defaultJoins: [],
})
}
}
One thing I'm wondering is allowedJoins accepts dot notated deep joins (eg. allowedJoins: ['tenant.users.comments', 'file']). Would be nice if that could be type safe as well.
Not sure when I'll have bandwidth for this, but I like the direction. PR's are also welcome if you feel like it :)
Description
Hello again, I am suggesting that we use the interface exported by @prisma/client on built to pass into
model:
during constructor.Motivation and Context
Examples
Instead of
We do
Reference
I've seen this being done in https://github.com/chax-at/prisma-filter that its
@DirectFilterPipe
will recognize the field types in the whitelist array.The text was updated successfully, but these errors were encountered: