Feature flags seeds, queries and hooks (#2769)

* seed is working

* allow graphql to retrieve feature flag data

* create useIsFeatureEnabled hook

* hook is working

* Update icons.ts
This commit is contained in:
bosiraphael
2023-11-29 16:40:44 +01:00
committed by GitHub
parent d855a42eca
commit 04c7c1a334
12 changed files with 174 additions and 17 deletions
@@ -1,6 +1,6 @@
import { Field, ID, ObjectType } from '@nestjs/graphql';
import { IDField } from '@ptc-org/nestjs-query-graphql';
import { IDField, UnPagedRelation } from '@ptc-org/nestjs-query-graphql';
import {
Column,
CreateDateColumn,
@@ -15,6 +15,7 @@ import { FeatureFlagEntity } from 'src/core/feature-flag/feature-flag.entity';
@Entity({ name: 'workspace', schema: 'core' })
@ObjectType('Workspace')
@UnPagedRelation('featureFlags', () => FeatureFlagEntity, { nullable: true })
export class Workspace {
@IDField(() => ID)
@PrimaryGeneratedColumn('uuid')
@@ -7,6 +7,7 @@ import { FileModule } from 'src/core/file/file.module';
import { WorkspaceManagerModule } from 'src/workspace/workspace-manager/workspace-manager.module';
import { WorkspaceResolver } from 'src/core/workspace/workspace.resolver';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
import { FeatureFlagEntity } from 'src/core/feature-flag/feature-flag.entity';
import { Workspace } from './workspace.entity';
import { workspaceAutoResolverOpts } from './workspace.auto-resolver-opts';
@@ -18,7 +19,10 @@ import { WorkspaceService } from './services/workspace.service';
TypeORMModule,
NestjsQueryGraphQLModule.forFeature({
imports: [
NestjsQueryTypeOrmModule.forFeature([Workspace], 'core'),
NestjsQueryTypeOrmModule.forFeature(
[Workspace, FeatureFlagEntity],
'core',
),
WorkspaceManagerModule,
FileModule,
],