Closed shellscape closed 1 year ago
This reflects to all model and types, not only views. And Prisma Client also does not change the names. So I don't plan to change the behavior.
If you want clean names, just use PascalCase
and @@map
directive in Prisma schema.
it doesn't look like youre familiar with the new views support. views are equivalent to models for generation. I believe you closed this prematurely
Your issue with "wrong" names for types for views occurs also for models and mongo nested types.
Just test it by creating a model foo_bar_baz
and see how the Prisma Client looks like prisma.foo_bar_baz.findMany()
.
you know what, I thought I was responding to a different issue lol. that's what I get for looking at the phone first thing out of bed..
Describe the Bug
I'm using the prisma preview
views
feature. I have a view defined as such:This package then generates resolvers that look like
aggregateItem_snapshots
and types like that look likeItem_snapshot
To Reproduce A quick guide how to reproduce the bug. You can paste here code snippets or even better, provide a link to the repository with minimal reproducible code example.
Expected Behavior
Resolvers that look like
aggregateItemSnapshots
are generated along with aItemSnapshot
typeLogs
unsure if needed
Environment (please complete the following information):
typegraphql-prisma
version 0.24.5Additional Context
The same goes for field names like
created_at
andupdated_at
. Most of the graphql generating tools I've used over the years take care of this conversion for you. Was surprised to find that wasn't the case here.