Skip to content

Commit

Permalink
Added fieldReference support
Browse files Browse the repository at this point in the history
  • Loading branch information
Brettm12345 committed Dec 3, 2022
1 parent d0cbfef commit 8b1d50b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path';
import {
checkModelHasModelRelation,
findModelByName,
isMongodbRawOp
isMongodbRawOp,
} from './helpers';
import { isAggregateInputType } from './helpers/aggregate-helpers';
import { AggregateOperationSupport, TransformerParams } from './types';
Expand Down Expand Up @@ -145,6 +145,8 @@ export default class Transformer {
result.push(
this.wrapWithZodValidators('z.literal(true)', field, inputType),
);
} else if (inputType.type.toString().includes('Ref')) {
return result;
} else {
const isEnum = inputType.location === 'enumTypes';

Expand Down Expand Up @@ -235,8 +237,8 @@ export default class Transformer {
inputType.type === this.name
? objectSchemaLine
: isEnum
? enumSchemaLine
: objectSchemaLine;
? enumSchemaLine
: objectSchemaLine;

const arr = inputType.isList ? '.array()' : '';

Expand Down

0 comments on commit 8b1d50b

Please sign in to comment.