Skip to content

Commit

Permalink
feat(primary-id-field): add default filters
Browse files Browse the repository at this point in the history
  • Loading branch information
goldcaddy77 committed Apr 27, 2021
1 parent e6a6985 commit 1507f44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/decorators/PrimaryIdField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ import { composeMethodDecorators } from '../utils';
import { getCombinedDecorator } from './getCombinedDecorator';

interface PrimaryIdFieldOptions extends DecoratorCommonOptions {
filter?: true | IdWhereOperator[];
filter?: boolean | IdWhereOperator[];
readonly?: boolean;
}

export function PrimaryIdField(options: PrimaryIdFieldOptions = {}): any {
if (typeof options.filter === 'undefined') {
options.filter = ['eq', 'in'];
}

const factories = getCombinedDecorator({
fieldType: 'id',
gqlFieldType: ID,
Expand Down

0 comments on commit 1507f44

Please sign in to comment.