For some weird reason I can't seem to explain just yet, the batchRead query isn't properly named during compilation when my object is named 'equipment', but works correctly if I change it to any other name.
Here's some actual code with multiple cases that work and the one that doesn't:
Prisma schema
model Channel {
@@map("channel")
id Int @id @default(autoincrement())
name String @unique
// other variables removed for the purpose of this issue
}
model ChannelCategory {
@@map("channel_category")
name String @id
channels Channel[]
}
model Equipment {
@@map("equipment")
id Int @id
name String @unique
}
import { queryType } from '@nexus/schema';
export const Query = queryType({
definition(t) {
t.crud.channel();
t.crud.channels({ ordering: true, filtering: true });
t.crud.channelCategory();
t.crud.channelCategories();
t.crud.equipment();
// t.crud.equipments(); <-- Property 'equipments' does not exist on type 'NexusPrismaFields<"Query">'.
}
});
I also gave a quick glance inside the node_modules files for the generated t.crud object and found this:
node_modules/@types/typegen-nexus-plugin-prisma/index.d.ts
Version used: 0.24.0
For some weird reason I can't seem to explain just yet, the batchRead query isn't properly named during compilation when my object is named 'equipment', but works correctly if I change it to any other name.
Here's some actual code with multiple cases that work and the one that doesn't:
Prisma schema
ObjectTypes
Channel.ts
ChannelCategory.ts
Equipment.ts
QueryType
I also gave a quick glance inside the node_modules files for the generated t.crud object and found this: node_modules/@types/typegen-nexus-plugin-prisma/index.d.ts
Any clues as to why this happens and how one could fix it, other than simply changing the name?