diff --git a/packages/query-graphql/__tests__/types/query/filter.type.spec.ts b/packages/query-graphql/__tests__/types/query/filter.type.spec.ts index 4a5e75650..7f8c54abd 100644 --- a/packages/query-graphql/__tests__/types/query/filter.type.spec.ts +++ b/packages/query-graphql/__tests__/types/query/filter.type.spec.ts @@ -307,10 +307,10 @@ describe('filter types', (): void => { @FilterableField() boolField!: boolean - @FilterableField({ filterTypeNamePrefix: `MyDate` }) + @FilterableField({ overrideFilterTypeNamePrefix: `MyDate` }) dateField!: Date - @FilterableField({ filterTypeNamePrefix: `MyCustomFloat` }) + @FilterableField({ overrideFilterTypeNamePrefix: `MyCustomFloat` }) floatField!: number } diff --git a/packages/query-graphql/src/decorators/filterable-field.decorator.ts b/packages/query-graphql/src/decorators/filterable-field.decorator.ts index 094051ab8..d5521942d 100644 --- a/packages/query-graphql/src/decorators/filterable-field.decorator.ts +++ b/packages/query-graphql/src/decorators/filterable-field.decorator.ts @@ -9,7 +9,7 @@ export type FilterableFieldOptions = { filterRequired?: boolean filterOnly?: boolean filterDecorators?: PropertyDecorator[] - filterTypeNamePrefix?: string + overrideFilterTypeNamePrefix?: string } & FieldOptions export interface FilterableFieldDescriptor { diff --git a/packages/query-graphql/src/types/query/field-comparison/field-comparison.factory.ts b/packages/query-graphql/src/types/query/field-comparison/field-comparison.factory.ts index c51300901..761519bd7 100644 --- a/packages/query-graphql/src/types/query/field-comparison/field-comparison.factory.ts +++ b/packages/query-graphql/src/types/query/field-comparison/field-comparison.factory.ts @@ -70,8 +70,8 @@ const isCustomFieldComparison = (options: FilterComparisonOptions): boolea !!options.allowedComparisons || !!options.decorators const getComparisonTypeName = (fieldType: ReturnTypeFuncValue, options: FilterComparisonOptions): string => { - if (options.typeNamePrefix) { - return `${options.typeNamePrefix}FilterComparison` + if (options.overrideTypeNamePrefix) { + return `${options.overrideTypeNamePrefix}FilterComparison` } if (isCustomFieldComparison(options)) { return `${upperCaseFirst(options.fieldName)}FilterComparison` @@ -85,7 +85,7 @@ type FilterComparisonOptions = { allowedComparisons?: FilterComparisonOperators[] returnTypeFunc?: ReturnTypeFunc decorators?: PropertyDecorator[] - typeNamePrefix?: string + overrideTypeNamePrefix?: string } /** @internal */ diff --git a/packages/query-graphql/src/types/query/filter.type.ts b/packages/query-graphql/src/types/query/filter.type.ts index 684a29bee..5d246bddb 100644 --- a/packages/query-graphql/src/types/query/filter.type.ts +++ b/packages/query-graphql/src/types/query/filter.type.ts @@ -112,7 +112,7 @@ function getOrCreateFilterType( allowedComparisons: advancedOptions?.allowedComparisons, returnTypeFunc, decorators: advancedOptions?.filterDecorators, - typeNamePrefix: advancedOptions?.filterTypeNamePrefix + overrideTypeNamePrefix: advancedOptions?.overrideFilterTypeNamePrefix }) const nullable = advancedOptions?.filterRequired !== true ValidateNested()(GraphQLFilter.prototype, propertyName)