Q43: How do you format errors or mask sensitive details in production?
By overriding the formatError hook in GraphQL engines (e.g., Apollo Server, GraphQL Yoga), servers can intercept errors before delivery. In production, stack traces and database internal details are masked or logged centrally, returning clean, user-friendly codes.
Key Takeaways
- Always sanitize
formatErrorpipelines in production to avoid leaking database schemas or stack traces.
Knowledge Check
What risk occurs if default error formatting is left unconfigured in production?