Skip to content

Commit 61a9141

Browse files
committed
fix
1 parent 98aec93 commit 61a9141

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/runtime/src/enhancements/delegate.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
getIdFields,
1313
getModelInfo,
1414
isDelegateModel,
15-
requireField,
1615
resolveField,
1716
} from '../cross';
1817
import type { CrudContract, DbClientContract } from '../types';
@@ -153,7 +152,10 @@ export class DelegateProxyHandler extends DefaultPrismaProxyHandler {
153152
for (const kind of ['select', 'include'] as const) {
154153
if (args[kind] && typeof args[kind] === 'object') {
155154
for (const [field, value] of Object.entries<any>(args[kind])) {
156-
const fieldInfo = requireField(this.options.modelMeta, model, field);
155+
const fieldInfo = resolveField(this.options.modelMeta, model, field);
156+
if (!fieldInfo) {
157+
continue;
158+
}
157159

158160
if (this.isDelegateOrDescendantOfDelegate(fieldInfo?.type) && value) {
159161
// delegate model, recursively inject hierarchy

0 commit comments

Comments
 (0)