HotChocolate tries to help you as much as possible to automatically generate the GraphQL schema for you when using the Code First approach. It will scan through all the types to look for public properties and methods and adds them as GraphQL fields to the schema object type.
But what if you want to exclude a specific field? Here are 2 possible ways to do this.
Ignoring a field
A first option is to ignore specific fields:
This is most useful when there is a limited number of fields that need to be excluded.
Binding fields explicitly
A second option you have is to disable the automatic scanning for a type and bind all fields explicitly. Therefore call the BindFieldsExplicitly method and then start to add fields manually:
More information: Object Types - Hot Chocolate - ChilliCream GraphQL Platform