moleculerjs/moleculer-apollo-server

err.originalError in formatError does not include Error code, type and data information

Opened this issue · 0 comments

When passing formatError to serverOptions, seems like graphql is stripping out error code, type and data which I can confirm is present in the catch block of createActionResolver in service.js. Does anyone know why this might be the case?

Here is the code I'm using in serverOptions to inspect error:

        formatError(err) {
          console.warn({
            originalError: err.originalError, // <--- does not include code, type or data
          });
          return err;
        },