我可以将 args 的类型从 graphql 的解析器更改为 id 吗?

Can I change the type of args from graphql's resolver to id?

我想在查询中更改 graphql 的 ID 类型的类型。可能吗?

id: 编号 ==> id: 编号

@Resolver()
export class LocationResolver {
    constructor(private readonly locationService: LocationService) {}

    @Query(() => Location_Group)
    async locationGroup(@Args('id') id: number): Promise<Location_Group> {
        return await this.locationService.getLocationGroup(id);
    }
}

这是我的回答:

@Query(() => Location)
async location(
    @Args('id', { type: () => ID }) id: number
): Promise<Location> {
    return await this.locationService.findLocation(id);
}