The middleware autogenerated by Kleeen provides an Apollo server and we follow the best practices and guidelines from Apollo. The following is a list of items to review the handling of as you move an application towards production.
Omitting or Including Stacktrace
exception.stacktraceerror field is useful while developing and debugging your server, but you probably don’t want to expose it to clients in production.
By default, Apollo Server omits the
exception.stacktracefield if the
NODE_ENVenvironment variable is set to either
You can override this default behavior by passing the
debugoption to the constructor of
exception.stacktraceis always included. If it’s
exception.stacktraceis always omitted.
Please note, that when
exception.stacktraceis omitted, it’s also unavailable to your application. To log error
stacktracewithout including them in responses to clients, see Masking and logging errors.
Making errors actionable on the client and server.
API Reference: ApolloServer
A guide to using Apollo Server (61 kB)
Making errors actionable on the client and server (50 kB)
If these configurations do not meet your needs, you can make additional customizations in the
apps/api/src/server/configureGraphQLServer.tsrepository folder to extend the Apollo server.
If you have any questions, please contact us at Support@Kleeen.Software.