def mutate_item_query(board, group, item_name, column_values): # Monday does not allow passing through non-JSON null values here, # so if you choose not to specify column values, need to set column_values to empty object. column_values = column_values if column_values else {} query = '''mutation { create_item ( board_id: %s, group_id: %s, item_name: "%s", column_values: %s ) { id } }''' % (board, group, item_name, monday_json_stringify(column_values)) return query
def update_multiple_column_values_query(board_id, item_id, column_values): query = '''mutation { change_multiple_column_values ( board_id: %s, item_id: %s, column_values: %s ) { id name column_values { id text } } }''' % (board_id, item_id, monday_json_stringify(column_values)) return query
def update_item_query(board_id, item_id, column_id, value): query = '''mutation { change_column_value( board_id: %s, item_id: %s, column_id: %s, value: %s ) { id name column_values { id text value } } }''' % (board_id, item_id, column_id, monday_json_stringify(value)) return query
def mutate_subitem_query(parent_item_id, subitem_name, column_values): column_values = column_values if column_values else {} return '''mutation { create_subitem ( parent_item_id: %s, item_name: "%s", column_values: %s ) { id, name, column_values { id, text }, board { id, name } } }''' % (parent_item_id, subitem_name, monday_json_stringify(column_values))