Resolvers and arguments — GraphQL · NestJS

Let the graph connect: a cat's owner and an owner's cats resolved only when a query asks for them, and the cats query taking a filter and paging through a class of arguments with defaults.

What you will learn

Read the theory for Resolvers and arguments

All GraphQL lessons

All NestJS courses

loading types…

What you'll learn

  • Resolve a field on demand with @ResolveField() and @Parent(), so that it costs nothing unless a query selects it
  • Split one type's fields across resolvers, so each module resolves what it knows
  • Gather a query's arguments in an @ArgsType() class, with optional arguments and defaults
  • Read the arguments and their defaults the schema publishes, through introspection