From 8735bd6704791244bc28b7c9dfcf0889aa2bb839 Mon Sep 17 00:00:00 2001 From: Javier Arias Date: Tue, 1 Feb 2022 15:23:31 +0000 Subject: [PATCH] Implement create funding mutation --- thothlibrary/client.py | 4 ++++ thothlibrary/mutation.py | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/thothlibrary/client.py b/thothlibrary/client.py index 9b5b82c..9da2140 100644 --- a/thothlibrary/client.py +++ b/thothlibrary/client.py @@ -115,6 +115,10 @@ def create_location(self, location): """Construct and trigger a mutation to add a new location object""" return self.mutation("createLocation", location) + def create_funding(self, funding): + """Construct and trigger a mutation to add a new funding object""" + return self.mutation("createFunding", funding) + @staticmethod def supported_versions(): """ diff --git a/thothlibrary/mutation.py b/thothlibrary/mutation.py index 7710080..a0d8b97 100644 --- a/thothlibrary/mutation.py +++ b/thothlibrary/mutation.py @@ -185,6 +185,18 @@ class ThothMutation(): ], "return_value": "locationId" }, + "createFunding": { + "fields": [ + ("workId", True), + ("institutionId", True), + ("program", True), + ("projectName", False), + ("projectShortname", False), + ("grantNumber", False), + ("jurisdiction", False) + ], + "return_value": "fundingId" + }, "updateWork": { "fields": [ ("workId", True),