GraphQL API V4 - Error "Resource not accessible by integration" on any field with argument

i’ve been trying to search repositories using the GraphQl API , and apollo-client in a next.js app

with this query : 

query Search($query:String!,$type:SearchType!){
  search(type:$type,query:$query,first:10){

    nodes{
      ... on Repository{
        description,
        url,
        name,
        ... on RepositoryInfo{
          openGraphImageUrl
        },
        issues(states:OPEN){
          totalCount
        },
        stargazers{
          totalCount
        },
        labels(first:5){
          totalCount,
          nodes{
            color,
            name,
            url
          }
        }
      }
    }
  }
}

but i receive this as response :

{
type: "FORBIDDEN",
path:["search", "nodes", 0, "labels"],
extensions: {saml_failure: false},
locations:[extensions: {saml_failure: false}],
message: "Resource not accessible by integration"
}

i also tried with this query from github api documentation https://developer.github.com/v4/guides/forming-calls/#example-query :

repository(owner:"octocat", name:"Hello-World") {
    issues(last:20, states:CLOSED) {
      edges {
        node {
          title
          url
          labels(first:5) {
            edges {
              node {
                name
              }
            }
          }
        }
      }
    }
  }

i tried with another client like graphql-request and is the same answer, by the way : both queries runs very well on the GraphQl explorer from github ,and now my question is : Why is this happening, is , and how i can get it solved ?

2 Likes

I just had the same problem, it looks like stargazers caused it, and no scope was found for this.

{
    "data":{
        "repository":null
    },
    "errors":[
        {
            "type":"FORBIDDEN",
            "path":[
                "repository",
                "stargazers"
            ],
            "extensions":{
                "saml_failure":false
            },
            "locations":[
                {
                    "line":11,
                    "column":5
                }
            ],
            "message":"Resource not accessible by integration"
        }
    ]
}