Remove groupBy feature flag (#15281)
This commit is contained in:
+2
-8
@@ -42,19 +42,13 @@ export class GqlTypeGenerator {
|
||||
private readonly mutationTypeGenerator: MutationTypeGenerator,
|
||||
) {}
|
||||
|
||||
async buildAndStore(
|
||||
objectMetadataCollection: ObjectMetadataEntity[],
|
||||
workspaceId: string,
|
||||
) {
|
||||
async buildAndStore(objectMetadataCollection: ObjectMetadataEntity[]) {
|
||||
const compositeTypeCollection = [...compositeTypeDefinitions.values()];
|
||||
|
||||
this.buildAndStoreCompositeFieldMetadataGqlTypes(compositeTypeCollection);
|
||||
this.buildAndStoreDateFieldMetadataGroupByGqlTypes();
|
||||
this.buildAndStoreObjectMetadataGqlTypes(objectMetadataCollection);
|
||||
await this.queryTypeGenerator.buildAndStore(
|
||||
objectMetadataCollection,
|
||||
workspaceId,
|
||||
);
|
||||
await this.queryTypeGenerator.buildAndStore(objectMetadataCollection);
|
||||
this.mutationTypeGenerator.buildAndStore(objectMetadataCollection);
|
||||
}
|
||||
|
||||
|
||||
+2
-15
@@ -6,8 +6,6 @@ import { workspaceResolverBuilderMethodNames } from 'src/engine/api/graphql/work
|
||||
import { GqlOperation } from 'src/engine/api/graphql/workspace-schema-builder/enums/gql-operation.enum';
|
||||
import { RootTypeGenerator } from 'src/engine/api/graphql/workspace-schema-builder/graphql-type-generators/root-types/root-type.generator';
|
||||
import { GqlTypesStorage } from 'src/engine/api/graphql/workspace-schema-builder/storages/gql-types.storage';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||
import { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
|
||||
@Injectable()
|
||||
@@ -15,23 +13,12 @@ export class QueryTypeGenerator {
|
||||
constructor(
|
||||
private readonly rootTypeGenerator: RootTypeGenerator,
|
||||
private readonly gqlTypesStorage: GqlTypesStorage,
|
||||
private readonly featureFlagService: FeatureFlagService,
|
||||
) {}
|
||||
|
||||
async buildAndStore(
|
||||
objectMetadataCollection: ObjectMetadataEntity[],
|
||||
workspaceId: string,
|
||||
) {
|
||||
const isGroupByEnabled = await this.featureFlagService.isFeatureEnabled(
|
||||
FeatureFlagKey.IS_GROUP_BY_ENABLED,
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
async buildAndStore(objectMetadataCollection: ObjectMetadataEntity[]) {
|
||||
return this.rootTypeGenerator.buildAndStore(
|
||||
objectMetadataCollection,
|
||||
[...workspaceResolverBuilderMethodNames.queries].filter(
|
||||
(methodName) => methodName !== 'groupBy' || isGroupByEnabled,
|
||||
),
|
||||
workspaceResolverBuilderMethodNames.queries,
|
||||
GqlOperation.Query,
|
||||
);
|
||||
}
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ export class RootTypeGenerator {
|
||||
|
||||
buildAndStore(
|
||||
objectMetadataCollection: ObjectMetadataEntity[],
|
||||
workspaceResolverMethodNames: WorkspaceResolverBuilderMethodNames[],
|
||||
workspaceResolverMethodNames: readonly WorkspaceResolverBuilderMethodNames[],
|
||||
objectTypeName: GqlOperation,
|
||||
) {
|
||||
if (workspaceResolverMethodNames.length === 0) {
|
||||
@@ -61,7 +61,7 @@ export class RootTypeGenerator {
|
||||
|
||||
private generateFields(
|
||||
objectMetadataCollection: ObjectMetadataEntity[],
|
||||
workspaceResolverMethodNames: WorkspaceResolverBuilderMethodNames[],
|
||||
workspaceResolverMethodNames: readonly WorkspaceResolverBuilderMethodNames[],
|
||||
): GraphQLRootTypeFieldConfigMap {
|
||||
const fieldConfigMap: GraphQLRootTypeFieldConfigMap = {};
|
||||
|
||||
|
||||
+1
-5
@@ -19,12 +19,8 @@ export class WorkspaceGraphQLSchemaGenerator {
|
||||
|
||||
async generateSchema(
|
||||
objectMetadataCollection: ObjectMetadataEntity[],
|
||||
workspaceId: string,
|
||||
): Promise<GraphQLSchema> {
|
||||
await this.gqlTypeGenerator.buildAndStore(
|
||||
objectMetadataCollection,
|
||||
workspaceId,
|
||||
);
|
||||
await this.gqlTypeGenerator.buildAndStore(objectMetadataCollection);
|
||||
|
||||
// Assemble schema
|
||||
const schema = new GraphQLSchema({
|
||||
|
||||
Reference in New Issue
Block a user