I would like to change the type from graphql's ID type in the query. Is it possible?
id: number ==> 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);
}
}
It is my answer:
@Query(() => Location)
async location(
@Args('id', { type: () => ID }) id: number
): Promise<Location> {
return await this.locationService.findLocation(id);
}