Skip to content

Commit

Permalink
fix(client): chaining on capitalized columns
Browse files Browse the repository at this point in the history
  • Loading branch information
millsp committed Feb 9, 2022
1 parent 8391602 commit 95926d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ model Property {

model House {
id String @id @default(cuid())
like Like @relation(fields: [likeId], references: [id])
Like Like @relation(fields: [likeId], references: [id])
properties Property[]
likeId String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test('chaining', async () => {
})
.property()
.house()
.like(),
.Like(),
)

a.push(
Expand All @@ -47,7 +47,7 @@ test('chaining', async () => {
})
.property()
.house()
.like()
.Like()
.post(),
)

Expand All @@ -60,7 +60,7 @@ test('chaining', async () => {
})
.property()
.house()
.like()
.Like()
.post()
.author(),
)
Expand All @@ -74,7 +74,7 @@ test('chaining', async () => {
})
.property()
.house()
.like()
.Like()
.post()
.author()
.property(),
Expand Down
3 changes: 1 addition & 2 deletions packages/client/src/runtime/core/model/applyFluent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Client } from '../../getPrismaClient'
import { deepSet } from '../../utils/deep-set'
import { dmmfToJSModelName } from './utils/dmmfToJSModelName'
import type { DMMF } from '@prisma/generator-helper'
import type { ModelAction } from './applyModel'
import { defaultProxyHandlers } from './utils/defaultProxyHandlers'
Expand All @@ -19,7 +18,7 @@ import type { UserArgs } from './UserArgs'
function getNextDataPath(fluentPropName?: string, prevDataPath?: string[]) {
if (fluentPropName === undefined || prevDataPath === undefined) return []

return [...prevDataPath, 'select', dmmfToJSModelName(fluentPropName)]
return [...prevDataPath, 'select', fluentPropName]
}

/**
Expand Down

0 comments on commit 95926d3

Please sign in to comment.