Skip to content

The open alternative to Salesforce, designed for AI.

fix: handle billingSubscriptions gql field if billing is disabled (#9767)

Etienne75ba270ba891
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts b/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
index 592d5d58d88..bcfb44a545c 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
@@ -167,6 +167,10 @@ export class WorkspaceResolver {
async billingSubscriptions(
@Parent() workspace: Workspace,
): Promise<BillingSubscription[] | undefined> {
+ if (!this.environmentService.get('IS_BILLING_ENABLED')) {
+ return [];
+ }
+
try {
return this.billingSubscriptionRepository.find({
where: { workspaceId: workspace.id },