hi folks, i’m wondering if there’s a way to use GraphQL query to get the whole team info with only team ID, from what i read in the doc, there’s Organization → Teams, with “search” as available input, from what i test, the “search” will only accept team name, but not team GraphQL ID
Hey @moveingsun ,
This is Suma from Buildkite support. First of all, welcome to Buildkite community and thank you for reaching out to us with your question.
In order to query about the team, you would have to use team slug which will be org slug followed by team slug. Here is an example query:
query GetTeam {
team(slug:"orgslug/teamslug"){
name
members(first:500){
... on TeamMemberConnection {
edges{
node{
user {
name
}
}
}
}
}
}
}
This will provide you information of all the users of the team. Please let us know if this meets your requirement.
Thanks,
Suma
thanks Suma! for teamslug, I guess it’s the team name? our db will only save team by it’s GraphQL ID, not team name. in that way, is there a way for me to use query to get team name in any query?
In this case, you would have to query graphQL to get all the teams in the org and then using the output map the GraphQL ID to get the team name which you can then use in your next query to get more details on that specific team.
query GetTeams {
organization(slug: "orgslug"){
teams(first:500){
edges{
node{
id
name
}
}
}
}
}
There is no option to query for team information using the ID. I hope this helps.
Thanks,
Suma
got it, thanks! this is a workaround that I could use