# -*- coding: utf-8 -*-
#
# ITerativ GmbH
# http://www.iterativ.ch/
#
# Copyright (c) 2018 ITerativ GmbH. All rights reserved.
#
# Created on 22.10.18
# @author: chrigu <christian.cueni@iterativ.ch>

import graphene
from django.contrib.auth import logout


class Logout(graphene.Mutation):
    success = graphene.Boolean()

    def mutate(self, info, **kwargs):
        try:
            logout(info.context)
            return Logout(success=True)
        except Exception:
            return Logout(success=False)
