diff --git a/README.md b/README.md index 51233e6..e4538bd 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Install is either via pip or cloning the repository. From pip: ```sh -python3 -m pip install thothlibrary==0.22.0 +python3 -m pip install thothlibrary==0.23.0 ``` Or from the repo: diff --git a/thothlibrary/__init__.py b/thothlibrary/__init__.py index 3046b53..499e3ef 100644 --- a/thothlibrary/__init__.py +++ b/thothlibrary/__init__.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """GraphQL client for Thoth""" -__version__ = "0.22.0" +__version__ = "0.23.0" __author__ = "Javier Arias " __copyright__ = "Copyright (c) 2020 Open Book Publishers" __license__ = "Apache 2.0" diff --git a/thothlibrary/client.py b/thothlibrary/client.py index 679767f..007e19a 100644 --- a/thothlibrary/client.py +++ b/thothlibrary/client.py @@ -136,6 +136,10 @@ def update_work(self, work): """Construct and trigger a mutation to update a work object""" return self.mutation("updateWork", work) + def update_contributor(self, contributor): + """Construct and trigger a mutation to update a contributor object""" + return self.mutation("updateContributor", contributor) + def update_institution(self, institution): """Construct and trigger a mutation to update an institution object""" return self.mutation("updateInstitution", institution) diff --git a/thothlibrary/mutation.py b/thothlibrary/mutation.py index a32c51c..3cbe1aa 100644 --- a/thothlibrary/mutation.py +++ b/thothlibrary/mutation.py @@ -291,6 +291,17 @@ class ThothMutation(): ], "return_value": "institutionId" }, + "updateContributor": { + "fields": [ + ("contributorId", True), + ("firstName", True), + ("lastName", True), + ("fullName", True), + ("orcid", True), + ("website", True) + ], + "return_value": "contributorId" + }, "deleteLocation": { "fields": [ ("locationId", True),