In the code-first approach with NestJS, you start by defining TypeScript classes representing your GraphQL types. You decorate these classes with @ObjectType and their properties with @Field to mark them for inclusion in the GraphQL schema. NestJS reads these decorated classes at runtime and automatically generates the GraphQL schema from them. This means you do not have to write schema files manually. Once the schema is generated, the GraphQL server runs and can respond to client queries based on the defined types. Properties without the @Field decorator are ignored in the schema and won't be queryable. This approach keeps your schema and code in sync and simplifies development.