A utility library for masking internal error messages in GraphQL responses. Version 2.1.0 (stable) – low release cadence. Provides `maskErrors()` to intercept and replace error messages with a generic 'internal error' string, while logging the full error server-side for debugging. Differentiates from alternatives like `graphql-middleware` or `formatError` by operating directly on the schema with minimal configuration. Requires `graphql` >0.4.0 as a peer dependency.
npm install graphql-errorsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates masking a GraphQL schema to replace sensitive error messages.
Ensure you call maskErrors before using the schema in a server.
Consider using graphql-js's formatError option or a middleware library.
Separately handle validation errors or use a custom formatError function.
Ensure schema is fully built and has query type before calling maskErrors.
Convert schema to GraphQLSchema using buildSchema or GraphQLSchema constructor first.