juniorGraphQL

What is a Resolver in GraphQL?

Updated Apr 28, 2026

Short answer

A Resolver is a function responsible for populating the data for a single field in your schema.

Deep explanation

Every field in a GraphQL query corresponds to a resolver function. If a resolver returns an object, execution continues to the next level of resolvers. If it returns a scalar, execution for that branch completes.

Real-world example

Writing a function that executes an SQL query to find a user when the user field is requested.

Common mistakes

  • Putting too much business logic inside resolvers instead of delegating to a separate service/domain layer.

Follow-up questions

  • What are the four arguments passed to every resolver?

More GraphQL interview questions

View all →