from typing import Annotated

from nestipy.graphql import Resolver, Query, Mutation
from nestipy.ioc import Inject, Arg

from .{{name|lower}}_input import {{name|capitalize}}Input
from .{{name|lower}}_service import {{name|capitalize}}Service


@Resolver()
class {{name|capitalize}}Resolver:

    {{name|lower}}_service: Annotated[{{name|capitalize}}Service, Inject()]

    @Query()
    async def {{name|lower}}_query(self) -> str:
        return await self.{{name|lower}}_service.list()

    @Mutation()
    async def {{name|lower}}_mutation(self,data: Annotated[{{name|capitalize}}Input, Arg()]) -> str:
        return data.test
