Server
Output chaining

Output chaining

Output validation schemas can be chained similarly to argument schemas. This chaining capability allows for comprehensive validation of the output data returned by the resolver function. By specifying and chaining validation criteria within the output schema, you can ensure that the resulting data conforms to the expected structure and constraints before being sent back to the client. This approach promotes consistency, reliability, and data integrity throughout the mutation process.

resolver
  .output(Type.Object({ firstName: Type.String() }))
  .output(Type.Object({ lastName: Type.String() }));