How do you omit fields in TypegraphQL

Viewed 17

Let's say we have the following User model. { id: ID, email: string, username: string }

Then I want to define 2 queries:

  1. Used by the owner to get their settings page so it contains sensitive information such as email (perhaps sin number)
  2. Used by other users to search for a user (by username) & we do NOT want to expose the email or sin number I have been researching the documentation & cannot find how to accomplish this. I was thinking to grab the info for the fields manually & parse it per query but that seems like an oversight.
0 Answers
Related