diff options
author | Mark Powers <mark@marks.kitchen> | 2020-12-28 21:53:47 -0600 |
---|---|---|
committer | Mark Powers <mark@marks.kitchen> | 2020-12-28 21:53:47 -0600 |
commit | a160d7d9f082a65a7a2b4ffc0e6fe86174ebfac4 (patch) | |
tree | 667c2cb1993b68a8b519af7148b04ee49f2ed38e /graphql_queries.py | |
parent | 5745b14719e7c16c12d85b60adafd6ea0335731e (diff) |
Add move command
Diffstat (limited to 'graphql_queries.py')
-rw-r--r-- | graphql_queries.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/graphql_queries.py b/graphql_queries.py index 6d7094f..db23f23 100644 --- a/graphql_queries.py +++ b/graphql_queries.py @@ -19,3 +19,23 @@ def edit_page(page_id, content, title, path): query = 'mutation ($id: Int!, $content: String!, $path: String!, $title: String!){\npages {\nupdate(\nid: $id\ncontent: $content\ndescription: ""\neditor: "markdown"\nisPrivate: false\nisPublished: true\nlocale: "en"\npath: $path\npublishEndDate: ""\npublishStartDate: ""\nscriptCss: ""\nscriptJs: ""\ntags: []\ntitle: $title\n) {\nresponseResult {\nsucceeded\nerrorCode\nslug\nmessage\n__typename\n}\npage {\nid\nupdatedAt\n__typename\n}\n__typename\n}\n__typename\n}\n}' query_vars = {"id": page_id, "content": content, "title": title, "path": path} return custom_requests.send_query(query, query_vars) + +def move_page(page_id, destination_path): + query = '''mutation ($id: Int!, $destinationPath: String!, $destinationLocale: String!) { + pages { + move(id: $id, destinationPath: $destinationPath, destinationLocale: $destinationLocale) { + responseResult { + succeeded + errorCode + slug + message + __typename + } + __typename + } + __typename + } + }''' + query_vars = {"id": page_id, "destinationPath": destination_path, "destinationLocale": "en"} + return custom_requests.send_query(query, query_vars) + |