GraphQL : Searched with a keyword, provides a list of repositories and for each repository to provide the collaborators using github API

Keywords´╝Ü graphql github-api

Question: 

search using keyword for repositories and find all repositories associated with that repositories in git hub , listing collaborators of each repository.

The search for repositories with the keyword is working fine, i was able to get the name of each repositories, but not collaborators, with that I'm getting must have push access to view collaborators.

query {

rateLimit{
    cost
    remaining
    resetAt
}
search(query: "-js created:>2015-01-01 language:JavaScript", type:REPOSITORY, first: 20) {
    repositoryCount
    pageInfo {
        hasNextPage
        endCursor
        startCursor
    }
    edges {
        node {
            ... on Repository {
                name
                url
                collaborators(first: 100, affiliation: ALL)
              {
                edges{
                  node{
                    name
                  }
                }
              }
            }
        }
    }
}

I will get the collaborators if i do like below, but i want to use the search functionality and get the collaborators of only searched repositories.

{ user(login: "xxxx") {

repositories(first: 100){
  nodes{

      name
      url
        collaborators(first:100,affiliation:ALL){
      nodes{
        name
      }
    }

  }
}

} }

Answers: