import '@things-factory/auth-base' /* for Resolver Context */

import { Resolver, Query, Arg, Ctx } from 'type-graphql'
import { getRepository } from '@things-factory/shell'
import { EvaluationStatus } from './evaluation-status'

@Resolver(EvaluationStatus)
export class EvaluationStatusQuery {
  @Query(returns => EvaluationStatus!, { nullable: true, description: 'To fetch a EvaluationStatus' })
  async evaluationStatus(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<EvaluationStatus> {
    return await getRepository(EvaluationStatus).findOne({
      where: { id }
    })
  }
}
