-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added mutation for multiple items #106
base: master
Are you sure you want to change the base?
Conversation
Fixed typo in line 36
…erations in batches.
Hi @chdastolfo, please let me know if there's time to review this pull request. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! This looks good, but could you please add test(s) for this as well? It would be good, for example, to make sure this query looks right for various lengths of if the item_data
array (length, 1, >1).
@@ -401,7 +431,7 @@ def get_columns_by_board_query(board_ids): | |||
}''' % board_ids | |||
|
|||
|
|||
def create_board_by_workspace_query(board_name: str, board_kind: BoardKind, workspace_id = None) -> str: | |||
def create_board_by_workspace_query(board_name: str, board_kind: BoardKind, workspace_id=None) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
@@ -59,6 +59,37 @@ def mutate_subitem_query(parent_item_id, subitem_name, column_values, | |||
str(create_labels_if_missing).lower()) | |||
|
|||
|
|||
def mutate_multiple_items_query(items_data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer item_data
, and data
as it is more grammatically correct than items_data
and item_data
. I think the function name makes it clear that the function acts on multiple items.
Also! Please add this method to the docs in |
@chdastolfo Being able to group mutations/queries is a really useful feature. Are there any plans for this PR to make it into a release? |
Added a function which allows to modify multiple items at once using graphQL's mutation query.
The function takes a list of dictionaries with methods and any additional parameters the method requires.
This already saved me hours when working with large sets of data, as the only way to work with multiple items with this library was to call the update/create functions one by one, whereas now you're able to perform multiple operations at once.
Hope you find it as much of a lifesaver too!