Skip to content

Commit 87a9f7f

Browse files
authored
fix(proxy): enhance omit configuration to include Unsupported fields (#2441)
1 parent a49c2da commit 87a9f7f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

packages/cli/src/actions/proxy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,18 @@ export async function run(options: Options) {
7575

7676
const schemaModule = (await jiti.import(path.join(outputPath, 'schema'))) as any;
7777

78-
// Build omit configuration for computed fields
78+
// Build omit configuration for computed fields and Unsupported fields.
7979
const schema = schemaModule.schema as SchemaDef;
8080
const omit: Record<string, Record<string, boolean>> = {};
8181
for (const [modelName, modelDef] of Object.entries(schema.models)) {
82-
const computedFields: Record<string, boolean> = {};
82+
const omitFields: Record<string, boolean> = {};
8383
for (const [fieldName, fieldDef] of Object.entries(modelDef.fields)) {
84-
if (fieldDef.computed === true) {
85-
computedFields[fieldName] = true;
84+
if (fieldDef.computed === true || fieldDef.type === 'Unsupported') {
85+
omitFields[fieldName] = true;
8686
}
8787
}
88-
if (Object.keys(computedFields).length > 0) {
89-
omit[modelName] = computedFields;
88+
if (Object.keys(omitFields).length > 0) {
89+
omit[modelName] = omitFields;
9090
}
9191
}
9292

0 commit comments

Comments
 (0)