import graphene
from graphene_django import DjangoObjectType

from voting.types import VoteType

from .models import Submission
from .models import SubmissionType as ModelSubmissionType


class SubmissionTypeType(DjangoObjectType):
    class Meta:
        model = ModelSubmissionType
        only_fields = ("id", "name")


class SubmissionType(DjangoObjectType):
    votes = graphene.NonNull(graphene.List(graphene.NonNull(VoteType)))

    def resolve_votes(self, info):
        return self.votes.all()

    class Meta:
        model = Submission
        only_fields = (
            "id",
            "conference",
            "title",
            "elevator_pitch",
            "notes",
            "abstract",
            "owner",
            "helpers",
            "topic",
            "type",
            "duration",
            "votes",
        )

@@ -51,24 +51,55 @@
 ObjectType%0A%0A
+from voting.models import Vote%0A
 from voting.
@@ -430,16 +430,41 @@
 ne.List(
+VoteType))%0A    my_vote = 
 graphene
@@ -464,23 +464,21 @@
 raphene.
-NonNull
+Field
 (VoteTyp
@@ -482,11 +482,201 @@
 Type
-)))
+, user_id=graphene.ID())%0A%0A    def resolve_my_vote(self, info, user_id):%0A        try:%0A            return self.votes.get(user_id=user_id)%0A        except Vote.DoesNotExist:%0A            return None
 %0A%0A  

Add logged user vote field to SubmissionType