While exploring the GraphQL API, I have encountered a problem in making a group in a specific board:
The board query returns the board_id as an ID! , while the create_group expects the board_id as an Int! .
When I try to send my board_id as an Int! , I get a message that my library cannot coerce the number to an Int! .
When I try to send my board_id as an ID!, I get a type mismatch message between my variable (ID!) and the board_id argument (Int!).
How do I create a group in a specific board via the GraphQL API ?
You can then use a mutation like this one, passing the board ID that you got as a numeric value:
mutation {
create_group(board_id: 1234567890, group_name: "My group") {
id
title
}
}
Script wise when using variables:
You can take the ID you got as a string, turn it into a numeric value and pass the board ID as an Int!: mutation ($boardId: Int!) {...}
Let me know if that helps!
If it doesn’t, please send over you script so we can take a look!
What you have described is exactly what I am doing, but I did not realize the the ID is returned as a string instead of a numeric. I have made that change in my code, and the error is gone. Thank you for your guidance.
Following up on this, I’m running into the same problem again. I’ve changed how I’m using the python library (building queries dynamically instead of pre-written queries with variables), and it’s once again giving me the error:
Int cannot represent non 32-bit signed integer value
I have been able to track through some reports on the library itself, as well as the GraphQL specification documents, and have found that my library is correct, and that Monday’s implementation is out of spec:
The Int scalar type represents a signed 32-bit numeric non-fractional value.
I’m going to raise a bug with my library’s maintainers as well, but I don’t think they’re going to make changes that are outside of the specification.
What is the process for requesting a change on your side to bring Monday’s API back into specification?
In this case, I believe the issue lies in your library or script.
Our API works well with Python and we have multiple users using it regularly with this language and they are not encountering this issue.
I would advise to contact the team that maintains your library as you said and check with them what can be done, because again, it appears that the issue is not coming from monday since it would probably be an issue for all Python users if it was.
while I understand that it works with some implementations that are out of spec, too, “It works for me” isn’t a good answer for producing/requiring values that aren’t in-spec.
We just ran into this too, and are now abandoning integrating monday in our workflow more fully.
{
me {
name
}
boards(ids: [4531622611]) {
name
columns {
title
id
type
}
groups {
title
id
}
items {
name
group {
id
}
column_values {
id
value
}
}
}
}