/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth/refresh-token.aurora.yaml
 */
import { OAuthRefreshToken } from '@api/graphql';
import { OAuthFindRefreshTokenByIdHandler } from '@app/o-auth/refresh-token';
import { Auth } from '@aurora/decorators';
import { Timezone } from '@aurorajs.dev/core-back';
import { QueryStatement } from '@aurorajs.dev/core-common';
import { Args, Query, Resolver } from '@nestjs/graphql';

@Resolver()
@Auth('oAuth.refreshToken.get')
export class OAuthFindRefreshTokenByIdResolver {
  constructor(private readonly handler: OAuthFindRefreshTokenByIdHandler) {}

  @Query('oAuthFindRefreshTokenById')
  async main(
    @Args('id') id: string,
    @Args('constraint') constraint?: QueryStatement,
    @Timezone() timezone?: string,
  ): Promise<OAuthRefreshToken> {
    return await this.handler.main(id, constraint, {
      timezone,
    });
  }
}
