I’m trying to use GraphQL and export from a specific board all data ( group name,id, items, columns values ) except for a specific group and I can’t find a way to do that in a query. the query I use is:
query {
boards (ids: 1512837503) {
groups {
title
id
items(limit:100) {
name
column_values {
value
text
title
}
}
}
}
}
The output is too large and I don’t need the data in a specific group. Is there a way to add an exception of one group?
groups only accepts one argument that allows you to return data from specific group IDs. You could essentially try your request in reverse - add all group IDs except for the one you don’t need data from.
Would you be able to provide an example query that takes in a single group ID. I have a board with 12 groups and would like to target a single group for performance efficiency but I cannot figure out how to add any group id filtering on the query without an error being thrown.
Thank you for the response, but after spending a lot of time looking into this I don’t believe it is possible to filter by groups as part of the query. I’ve only been able to get calls to not error out when group data is included, but I have the then filter by it on my side to get to the select items needed.
Not sure if this is a path for new ideas, but it would be very useful if groups could be used to filter when doing a query/call so I don’t have to pull 5,000 rows to access 10.
Can you post the queries that error, and the errors? This kind of information helps a lot in either spotting the fix, or getting monday to fix the issue.
The first picture shows all groups on a board and I have underlined the one I am trying to target with a query. I’ve added a picture on the groups minimized on the board to see visually.
This picture is a query I got to work that included both groups and items, it shows a response with data but the data is not filtered by the group I’m trying to target, it returns much more:
For more context on what I am currently using is a python library also by the name of monday from which I import MondayClient and am able to use this to get the data from this board now, I would like to shift away from it so I don’t have to use pagination.
Hi Rachel, I’m not sure if you get notifications on a thread when I reply to someone else but I provided a response with screenshots and descriptions of my code.
I had tried the code you suggested prior to your suggestion. I agree the documentation reads in a way where that query should work because it says groups have an IDs argument to target a specific group to return. I haven’t been able to find a way for it work though, and have run into other threads online that confirmed the only way to filter by group was to do it locally after pulling all data.
I probably should have explained all that but that’s why I jumped straight to I don’t think it’s possible right now.
I agree with @anon29275264 here! Our default version is 2023-07 because 2023-10 contains many breaking changes. You will have to specify 2023-10 (or later) to get the items_page field. Here are the docs that explain how!
Wanted to loop back on this query you used in the one that didn’t filter by group as anticipated. This is pretty easy. You are putting items hierarchically under boards not groups see below, how moving just one } from after group.id to after the items changes the whole structure from getting the boards.items to boards.groups.items
I will definitely try to stick to 2023-10. I personally only use the api to get stuff out to manipulate it with python so no additional rewriting for me. I can tell the graph ql type api is a powerful tool, it’s the stuff like you showed with the hierarchy I’ve struggled to interpret from the documentation. Just am not working in the api enough though, I appreciate that tip. Best of luck with the rewriting!
Interesting discussion and all valid points. However the title says: "GraphQL - how can I get data from all groups except for one?"
And that one is not answered . I guess the only solution is to retrieve all groupId in one call and then make another call (as suggested )including all the returned groupIds except the one you don’t want.