Skip to content

Commit

Permalink
Implement create funding mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Feb 1, 2022
1 parent 44e41b2 commit 8735bd6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions thothlibrary/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
"""
Expand Down
12 changes: 12 additions & 0 deletions thothlibrary/mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 8735bd6

Please sign in to comment.