def mutation_jwt_required(fn):
    """
    A decorator to protect a mutation.

    If you decorate a mutation with this, it will ensure that the requester
    has a valid access token before allowing the mutation to be called. This
    does not check the freshness of the access token.
    """
    @wraps(fn)
    def wrapper(cls, *args, **kwargs):
        token = kwargs.pop(current_app.config['JWT_TOKEN_ARGUMENT_NAME'])
        try:
            verify_jwt_in_argument(token)
        except Exception as e:
            return cls(AuthInfoField(message=str(e)))

        return fn(cls, *args, **kwargs)
    return wrapper