Pedestal's default top-level exception handler logs the entire Pedestal context; this is problematic with lacinia-pedestal, as the entire GraphQL query is inside the context, with numerous references to different parts of the compiled schema; logging this can be hundreds of kilobytes of output.
This PR ensures that, on exit (either normally, via the :leave callback, or via the :error callback) the values added to the context are removed, ensuring that the Pedestal context is (reasonably) clean by the time the top-level error reporting logic is hit.
This is important even in cases where the exception occurs outside of lacinia-pedestal, such as a problem streaming the JSON response to the client.
Pedestal's default top-level exception handler logs the entire Pedestal context; this is problematic with lacinia-pedestal, as the entire GraphQL query is inside the context, with numerous references to different parts of the compiled schema; logging this can be hundreds of kilobytes of output.
This PR ensures that, on exit (either normally, via the :leave callback, or via the :error callback) the values added to the context are removed, ensuring that the Pedestal context is (reasonably) clean by the time the top-level error reporting logic is hit.
This is important even in cases where the exception occurs outside of lacinia-pedestal, such as a problem streaming the JSON response to the client.