Update graphql query to find agents for workspace creation

Context - !114670 (comment 1356772450)

Instead of selecting an agent by querying it's parent group, we should query the agents of the root group of the project.

e.g. For the hierarchy gitlab.com/g1/g2/g3/example-project, if someone is creating a workspace for the project example-project, then we will get a list of agents for the group g1 instead of group g3.

Edited by Vishal Tak