[GraphQL] The `BoardsResolver` does not have a meaningful `.single` resolver
Summary
The BoardResolver.single
class will return a random board if given no arguments.
Steps to reproduce
The following GraphQL query makes no sense
query {
group(fullPath: "gitlab-org") {
board {
id
name
}
}
}
No ID is provided, but there are many boards. Which one will I get back? As of 2020-07-09, this returns:
{
"data": {
"group": {
"board": {
"id": "gid://gitlab/Board/962624",
"name": "11.10 Release"
}
}
}
}
We just get a random board.
What is the current bug behavior?
The ID argument is not required, and not providing one returns a random board. Users might be relying on the fiction that group has just one board.
What is the expected correct behavior?
The id
argument should be required.
Output of checks
This bug happens on GitLab.com
Possible fixes
At GroupType.board, we use BoardsResolver.single
, which has the behaviour of just returning the first value of the plural resolver.
Instead we should implement this resolver separately, with a required ID
argument.