A resolver is a function per field: (parent, args, context, info) => value. Fields without a resolver return parent[fieldName]. Argument Contains parent the object returned by the parent field's resolver args the field's arguments (already validated and coerced) context per-request data: current user, DB, loaders info AST and schema details (rarely needed) Mutations Mutations are fields on Mutation that change data and return the changed object so clients can update their cache. Top-level mutation fields run sequentially; query fields may run in parallel. Errors Throwing in a resolver puts an entry in errors[] and sets that field to null — the rest of the response still succeeds. Add an extensions.code (e.g. UNAUTHENTICATED, BADUSERINPUT) so clients can react.
Key Takeaways
Resolvers receive (parent, args, context, info); context carries the user and data sources.
Mutations return the modified object so clients can refresh their cache.
Errors are partial: a failing field becomes null and is listed in errors.
Add extensions.code to errors so clients can handle them programmatically.