Fix ObjectType casing and conflict between Relation and RelationMetadata (#9849)

Fixes #9827 

Also uncovered a conflict with `@objectType('Relation')` and
`@objectType('relation)`

I don't want to address it in this PR so I will create a followup issue
when we close this but I think there's a confusion between
Relation/RelationMetadata, it's unclear what is what

---------

Co-authored-by: Antoine Moreaux <moreaux.antoine@gmail.com>
This commit is contained in:
Félix Malfait
2025-01-28 10:06:18 +01:00
committed by GitHub
parent 08a0e67477
commit af8d22ee99
70 changed files with 22258 additions and 22058 deletions

View File

@ -17,9 +17,9 @@ import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/featu
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
@Entity({ name: 'featureFlag', schema: 'core' })
@ObjectType('FeatureFlag')
@ObjectType()
@Unique('IndexOnKeyAndWorkspaceIdUnique', ['key', 'workspaceId'])
export class FeatureFlagEntity {
export class FeatureFlag {
@IDField(() => UUIDScalarType)
@PrimaryGeneratedColumn('uuid')
id: string;

View File

@ -4,16 +4,14 @@ import { NestjsQueryGraphQLModule } from '@ptc-org/nestjs-query-graphql';
import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
@Module({
imports: [
TypeORMModule,
NestjsQueryGraphQLModule.forFeature({
imports: [
NestjsQueryTypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
],
imports: [NestjsQueryTypeOrmModule.forFeature([FeatureFlag], 'core')],
services: [],
resolvers: [],
}),

View File

@ -6,13 +6,13 @@ import { Repository } from 'typeorm';
import { FeatureFlagMap } from 'src/engine/core-modules/feature-flag/interfaces/feature-flag-map.interface';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
@Injectable()
export class FeatureFlagService {
constructor(
@InjectRepository(FeatureFlagEntity, 'core')
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
@InjectRepository(FeatureFlag, 'core')
private readonly featureFlagRepository: Repository<FeatureFlag>,
) {}
public async isFeatureEnabled(
@ -30,7 +30,7 @@ export class FeatureFlagService {
public async getWorkspaceFeatureFlags(
workspaceId: string,
): Promise<FeatureFlagEntity[]> {
): Promise<FeatureFlag[]> {
return this.featureFlagRepository.find({ where: { workspaceId } });
}