@@ -47,7 +47,7 @@ class Arguments:
4747 message = graphene .String ()
4848
4949 @login_required
50- def mutate (root , info , annotation_id ):
50+ def mutate (root , info , annotation_id ) -> "RemoveAnnotation" :
5151 try :
5252 user = info .context .user
5353 annotation_pk = from_global_id (annotation_id )[1 ]
@@ -96,7 +96,7 @@ class Arguments:
9696
9797 @login_required
9898 @transaction .atomic
99- def mutate (root , info , annotation_id , comment = None ):
99+ def mutate (root , info , annotation_id , comment = None ) -> "RejectAnnotation" :
100100 user = info .context .user
101101 annotation_pk = from_global_id (annotation_id )[1 ]
102102
@@ -159,7 +159,7 @@ class Arguments:
159159
160160 @login_required
161161 @transaction .atomic
162- def mutate (root , info , annotation_id , comment = None ):
162+ def mutate (root , info , annotation_id , comment = None ) -> "ApproveAnnotation" :
163163 user = info .context .user
164164 annotation_pk = from_global_id (annotation_id )[1 ]
165165
@@ -254,7 +254,7 @@ def mutate(
254254 annotation_label_id ,
255255 annotation_type ,
256256 long_description = None ,
257- ):
257+ ) -> "AddAnnotation" :
258258 corpus_pk = from_global_id (corpus_id )[1 ]
259259 document_pk = from_global_id (document_id )[1 ]
260260 label_pk = from_global_id (annotation_label_id )[1 ]
@@ -296,7 +296,9 @@ class Arguments:
296296 annotation = graphene .Field (AnnotationType )
297297
298298 @login_required
299- def mutate (root , info , corpus_id , document_id , annotation_label_id ):
299+ def mutate (
300+ root , info , corpus_id , document_id , annotation_label_id
301+ ) -> "AddDocTypeAnnotation" :
300302 annotation = None
301303 ok = False
302304
@@ -328,7 +330,7 @@ class Arguments:
328330 message = graphene .String ()
329331
330332 @login_required
331- def mutate (root , info , relationship_id ):
333+ def mutate (root , info , relationship_id ) -> "RemoveRelationship" :
332334 try :
333335 user = info .context .user
334336 relationship_pk = from_global_id (relationship_id )[1 ]
@@ -400,7 +402,7 @@ def mutate(
400402 relationship_label_id ,
401403 corpus_id ,
402404 document_id ,
403- ):
405+ ) -> "AddRelationship" :
404406 try :
405407 source_pks = list (
406408 map (lambda graphene_id : from_global_id (graphene_id )[1 ], source_ids )
@@ -479,7 +481,7 @@ class Arguments:
479481 message = graphene .String ()
480482
481483 @login_required
482- def mutate (root , info , relationship_ids ):
484+ def mutate (root , info , relationship_ids ) -> "RemoveRelationships" :
483485 user = info .context .user
484486 for graphene_id in relationship_ids :
485487 pk = from_global_id (graphene_id )[1 ]
@@ -542,7 +544,7 @@ def mutate(
542544 add_target_ids = None ,
543545 remove_source_ids = None ,
544546 remove_target_ids = None ,
545- ):
547+ ) -> "UpdateRelationship" :
546548 try :
547549 relationship_pk = from_global_id (relationship_id )[1 ]
548550 relationship = Relationship .objects .get (pk = relationship_pk )
@@ -662,7 +664,7 @@ class Arguments:
662664 message = graphene .String ()
663665
664666 @login_required
665- def mutate (root , info , relationships ):
667+ def mutate (root , info , relationships ) -> "UpdateRelations" :
666668 user = info .context .user
667669 for relationship in relationships :
668670 pk = from_global_id (relationship ["id" ])[1 ]
@@ -728,7 +730,7 @@ class Arguments:
728730 version = graphene .Int (description = "The new version number after update" )
729731
730732 @login_required
731- def mutate (root , info , note_id , new_content , title = None ):
733+ def mutate (root , info , note_id , new_content , title = None ) -> "UpdateNote" :
732734 from opencontractserver .annotations .models import Note
733735
734736 try :
@@ -826,7 +828,9 @@ class Arguments:
826828 obj = graphene .Field (NoteType )
827829
828830 @login_required
829- def mutate (root , info , document_id , title , content , corpus_id = None , parent_id = None ):
831+ def mutate (
832+ root , info , document_id , title , content , corpus_id = None , parent_id = None
833+ ) -> "CreateNote" :
830834 from opencontractserver .annotations .models import Note
831835 from opencontractserver .corpuses .models import Corpus
832836 from opencontractserver .documents .models import Document
0 commit comments