Having some trouble trouble shooting my error. I’ve read through a few other solutions to what I believe the problem I am having, but have yet to find a solution. Is column_type
not a String?
I am creating columns with the following code:
Note, I am using python=3.10
def create_columns(board_id, title, column_type, default_values=None):
if default_values:
vals_dict = {}
for cnt, vals in enumerate(default_values):
vals_dictccnt + 1] = vals
status_values = {"labels": vals_dict}
else:
status_values = ''
query = """
mutation ($boardId: ID!, $titleName: String!, $columnType: String!, $defaultValues: JSON) {
create_column(
board_id: $boardId
title: $titleName
column_type: $columnType
defaults: $defaultValues
) {
id
}
}
"""
variables = {
'boardId': board_id,
'titleName': title,
'columnType': column_type,
'defualtValues': json.dumps(status_values, separators=(',', ':'))
}
datas = {
'query': query,
'variables': variables
}
r_boards = requests.post(url=apiUrl, headers=headers, data=json.dumps(datas)) # make request
return r_boards
variables
>>>{'boardId': '123456', 'titleName': 'My - Title', 'columnType': 'status', 'defualtValues': '{"labels":{"1":"100 - column1","2":"200 - column2","3":"300 - column,,3"}}'}
Error Message
>>>{'errors': :{'message': 'Type mismatch on variable $columnType and argument column_type (String! / ColumnType!)', 'locations': :{'line': 6, 'column': 13}], 'path': :'mutation', 'create_column', 'column_type'], 'extensions': {'code': 'variableMismatch', 'variableName': 'columnType', 'typeName': 'String!', 'argumentName': 'column_type', 'errorMessage': 'Type mismatch'}}], 'account_id': 123456}