old_contents: from graphql import GraphQLError
  
  NOT_LOGGED_IN_MSG = 'User Not Logged in!'
  
  
  class IsAuthenticatedMiddleware(object):
      def resolve(self, next, root, info, **args):
          if not info.context.user.is_authenticated():
              raise GraphQLError(NOT_LOGGED_IN_MSG)
          return next(root, info, **args)
  
new_contents: from impact.graphql.utils.response_error import ResponseError
  NOT_LOGGED_IN_MSG = 'User Not Logged in!'
  
  
  class IsAuthenticatedMiddleware(object):
      def resolve(self, next, root, info, **args):
          if not info.context.user.is_authenticated():
              raise ResponseError(message=NOT_LOGGED_IN_MSG, code="401")
          return next(root, info, **args)
  
subject: replace GraphQLError object with custom ResponseError