Scalar Coercion

Understand how GraphQL scalar coercion works.

Scalar coercion is a term used by the type system, which translates the values returned by a resolver function into something that upholds the API contract. When we query or mutate data using our GraphQL schema, we need to understand two operations that occur in the GraphQL servers:

  • Result coercion: This is when the contract of a type that we accept from the server is upheld. In other words, it verifies the primitive values or object ...