Skip to content

Commit 0dd1545

Browse files
committed
chore: bump nestjs and graphql versions
1 parent d05c014 commit 0dd1545

File tree

19 files changed

+2820
-5744
lines changed

19 files changed

+2820
-5744
lines changed

apps/api/src/app.module.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo'
12
import { Module } from '@nestjs/common'
23
import { ConfigModule } from '@nestjs/config'
34
import { GraphQLModule } from '@nestjs/graphql'
@@ -6,6 +7,7 @@ import { mongoForRoot } from '../../../libs/common/src/utils/mongodb'
67
import { AccountCredentialsModule } from './account-credentials/account-credentials.module'
78
import { AppController } from './app.controller'
89
import { AppService } from './app.service'
10+
import { AsyncSchemaModule } from './async-schema/async-schema.module'
911
import { AuthModule } from './auth/auth.module'
1012
import { ContractsModule } from './contracts/contracts.module'
1113
import { IntegrationAccountsModule } from './integration-accounts/integration-accounts.module'
@@ -18,13 +20,13 @@ import { WorkflowActionsModule } from './workflow-actions/workflow-actions.modul
1820
import { WorkflowRunsModule } from './workflow-runs/workflow-runs.module'
1921
import { WorkflowTriggersModule } from './workflow-triggers/workflow-triggers.module'
2022
import { WorkflowsModule } from './workflows/workflows.module'
21-
import { AsyncSchemaModule } from './async-schema/async-schema.module';
2223

2324
@Module({
2425
imports: [
2526
ConfigModule.forRoot(),
2627
mongoForRoot(),
27-
GraphQLModule.forRoot({
28+
GraphQLModule.forRoot<ApolloDriverConfig>({
29+
driver: ApolloDriver,
2830
context: ({ req }) => ({ req }),
2931
autoSchemaFile: path.join(process.cwd(), 'generated/schema.graphql'),
3032
definitions: {

apps/api/src/auth/guards/graphql.guard.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'
22
import { GqlExecutionContext } from '@nestjs/graphql'
33
import { AuthGuard } from '@nestjs/passport'
4+
import { firstValueFrom } from 'rxjs'
45
import { UserService } from '../../users/services/user.service'
56
import { AuthPayload } from '../typings/AccessToken'
67
import { GqlContext } from '../typings/gql-context'
@@ -33,7 +34,7 @@ export class GraphqlGuard extends AuthGuard('jwt') implements CanActivate {
3334
if (typeof canActivate === 'boolean') {
3435
return canActivate
3536
}
36-
return await canActivate.toPromise()
37+
return await firstValueFrom(canActivate)
3738
}
3839

3940
getRequest(context: ExecutionContext): GqlContext['req'] {

apps/api/src/auth/resolvers/auth.resolver.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { UseGuards } from '@nestjs/common/decorators/core/use-guards.decorator'
55
import { Args, Mutation, Resolver } from '@nestjs/graphql'
66
import { ObjectId } from 'bson'
77
import { GraphQLBoolean, GraphQLString } from 'graphql'
8+
import { firstValueFrom } from 'rxjs'
89
import { EmailService } from '../../../../../libs/emails/src/services/email.service'
910
import { ResetPasswordTemplate } from '../../../../../libs/emails/src/templates/resetPasswordTemplate'
1011
import { ProjectService } from '../../projects/services/project.service'
@@ -179,17 +180,17 @@ export class AuthResolver {
179180
}
180181

181182
if (process.env.SIGN_UP_WORKFLOW_HOOK) {
182-
await this.httpService
183-
.request({
183+
await firstValueFrom(
184+
this.httpService.request({
184185
url: process.env.SIGN_UP_WORKFLOW_HOOK,
185186
method: 'POST',
186187
data: {
187188
username: user.username,
188189
email: user.email,
189190
...signUpWorkflowData,
190191
},
191-
})
192-
.toPromise()
192+
}),
193+
)
193194
}
194195

195196
const project = await this.projectService.createOne({

apps/api/src/integration-accounts/integration-accounts.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IntegrationAccountAuthorizer, IntegrationAccountService } from './servi
99
imports: [
1010
NestjsQueryGraphQLModule.forFeature({
1111
imports: [NestjsQueryTypegooseModule.forFeature([IntegrationAccount])],
12-
resolvers: [],
12+
dtos: [{ DTOClass: IntegrationAccount }],
1313
}),
1414
],
1515
providers: [IntegrationAccountResolver, IntegrationAccountService, IntegrationAccountAuthorizer],

apps/api/src/integration-actions/integration-actions.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IntegrationActionAuthorizer, IntegrationActionService } from './service
99
imports: [
1010
NestjsQueryGraphQLModule.forFeature({
1111
imports: [NestjsQueryTypegooseModule.forFeature([IntegrationAction])],
12-
resolvers: [],
12+
dtos: [{ DTOClass: IntegrationAction }],
1313
}),
1414
],
1515
providers: [IntegrationActionResolver, IntegrationActionService, IntegrationActionAuthorizer],

apps/api/src/integration-triggers/integration-triggers.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IntegrationTriggerAuthorizer, IntegrationTriggerService } from './servi
99
imports: [
1010
NestjsQueryGraphQLModule.forFeature({
1111
imports: [NestjsQueryTypegooseModule.forFeature([IntegrationTrigger])],
12-
resolvers: [],
12+
dtos: [{ DTOClass: IntegrationTrigger }],
1313
}),
1414
],
1515
providers: [IntegrationTriggerResolver, IntegrationTriggerService, IntegrationTriggerAuthorizer],

apps/api/src/integrations/integrations.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IntegrationService } from './services/integration.service'
99
imports: [
1010
NestjsQueryGraphQLModule.forFeature({
1111
imports: [NestjsQueryTypegooseModule.forFeature([Integration])],
12-
resolvers: [],
12+
dtos: [{ DTOClass: Integration }],
1313
}),
1414
],
1515
providers: [IntegrationResolver, IntegrationService, IntegrationAuthorizer],

apps/api/src/users/users.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { UserService } from './services/user.service'
1313
imports: [
1414
NestjsQueryGraphQLModule.forFeature({
1515
imports: [NestjsQueryTypegooseModule.forFeature([User, UserProvider])],
16-
resolvers: [],
16+
dtos: [{ DTOClass: User }],
1717
}),
1818
EmailsModule,
1919
],

apps/api/src/workflow-runs/workflow-runs.module.ts

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { WorkflowSleepService } from './services/workflow-sleep.service'
3434
delete: { disabled: true },
3535
},
3636
],
37+
dtos: [{ DTOClass: WorkflowRun }, { DTOClass: WorkflowSleep }],
3738
}),
3839
UsersModule,
3940
WorkflowsModule,

0 commit comments

Comments
 (0)