/**
 * @aurora-catalyst-generated
 * @source cliter/o-auth/application.aurora.yaml
 */
import { OAuthApplication } from '@api/graphql';
import { OAuthFindApplicationByIdHandler } from '@app/o-auth/application';
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.application.get')
export class OAuthFindApplicationByIdResolver {
  constructor(private readonly handler: OAuthFindApplicationByIdHandler) {}

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