How to get an array of input type inside the resolver in GraphQL How to get an array of input type inside the resolver in GraphQL typescript typescript

How to get an array of input type inside the resolver in GraphQL


This works when the input type argument is defined as,

@Args({ name: 'ids', type: () => [String] }) ids: String[]

Below is how the mutation resolver looks like:

@UseGuards(GraphqlAuthGuard)@Mutation(() => String)async deletePeople(@Args({ name: 'ids', type: () => [String] }) ids: String[]) : Promise<String> {  const result = await this.peopleService.deletePeople(ids);  return JSON.stringify(result);}

Credits go to @vinujan.s