Answers for "how does we know which field is selected by user in nestjs query"

0

how does we know which field is selected by user in nestjs query

@UseGuards(GqlAuthGuard)
  @Query(returns => UserType)
  async getMe(@CurrentUser() user: User, @Info() info): Promise<User> {
    console.log(
      info.fieldNodes[0].selectionSet.selections.map(item => item.name.value),
    );
    return user;
  }
Posted by: Guest on July-20-2021

Code answers related to "how does we know which field is selected by user in nestjs query"

Code answers related to "Javascript"

Browse Popular Code Answers by Language