Refacto rest api, fix graphl playground, improve analytics (#5844)

- Improve the rest api by introducing startingAfter/endingBefore (we
previously had lastCursor), and moving pageInfo/totalCount outside of
the data object.
- Fix broken GraphQL playground on website
- Improve analytics by sending server url
This commit is contained in:
Félix Malfait
2024-06-12 21:54:33 +02:00
committed by GitHub
parent 04edf2bf7b
commit 374237a988
22 changed files with 277 additions and 131 deletions

View File

@ -8,6 +8,7 @@ import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorat
import { AuthUser } from 'src/engine/decorators/auth/auth-user.decorator';
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
import { User } from 'src/engine/core-modules/user/user.entity';
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
import { AnalyticsService } from './analytics.service';
import { Analytics } from './analytics.entity';
@ -17,7 +18,10 @@ import { CreateAnalyticsInput } from './dtos/create-analytics.input';
@UseGuards(OptionalJwtAuthGuard)
@Resolver(() => Analytics)
export class AnalyticsResolver {
constructor(private readonly analyticsService: AnalyticsService) {}
constructor(
private readonly analyticsService: AnalyticsService,
private readonly environmentService: EnvironmentService,
) {}
@Mutation(() => Analytics)
track(
@ -32,7 +36,7 @@ export class AnalyticsResolver {
workspace?.id,
workspace?.displayName,
workspace?.domainName,
request.hostname,
this.environmentService.get('SERVER_URL') ?? request.hostname,
);
}
}