V4 API returning 401 Bad Credentials


#1

I set up a lambda function with the following query to hit the api once an hour:

query {
        repository(owner: "Microsoft", name:"vscode") {
            issues(states:OPEN) {
              totalCount
            }
          }
    }

But for some reason, after awhile I’ve been getting only 401 requests back. I opened the response headers and the x-rate-limit header is 0, so was the access token blocked possibly for some reason? I don’t think it’s particularly costing because I went to the explorer and the cost of the above query is only 1.


#2

For reference on the project which this is being used for: https://vscode-issue-tracker.netlify.com/

As you can see in the top graph, there are often gaps where some hours the lambda function is failing because it is returning an unauthorized function even though the access token I gave the lambda function has the correct permissions.