Skip to content

Pass the proper app error to clients instead of GraphQLError

Andrei Cioromila requested to merge graphql-format-error into master

By default apollo-server wraps all errors passed from resolvers in a GraphQLError

Ideally, we would not pass tehnical errors to clients. They only need to be logged for debugging purposes.

This MR only allows errors defined in @pubsweet/errors to reach the client. All other errors are logged and a generic Server Error is passed to the client

In addition to this MR, I suggest we also provide a property on each error with user friendly error messages and information weather it should reach the client or only be logged. Please provide your opinions

Edited by Andrei Cioromila

Merge request reports