A field resolver is decorated with @ResolveField() and lazily resolves a single field on a parent type. It only executes when that specific field is actually requested by the client. Use field resolvers for related data that requires a separate fetch — this avoids over-fetching when clients do not need the related data.
Field resolvers are lazy — they only execute when the client explicitly requests that field.
Without field resolvers every user query would eagerly load posts even when not needed.
This is GraphQL's core efficiency advantage over REST — you only pay for data you request.
@Parent() injects the parent object (the resolved User) so you can use its ID for the sub-query.
Field resolvers are the primary integration point for DataLoader to solve the N+1 problem.