Skip to content

Repository 'type': 'NOT_FOUND' graphQL API #24737

Answered by 1121589
1121589 asked this question in Enterprise
Discussion options

You must be logged in to vote

Hi,

Meantime i managed to solve this.

Not entirely sure about the science behind this.
After printing the post payload that i was sending to github (response.requests.headers) i found out that the requests library was dropping the headers. After some reading it seems that it’s due to a redirection of url and for security reasons it drops the headers that contains my token.

What i did to solve was the following:
(This class is used to avoid using .netrc config)

class NullAuth(requests.auth.AuthBase):
    def __call__(self, r):
        return r

And than passed it along:

response = requests.post(url=GRAPHQL_URL, json=query, headers=self._headers, auth=NullAuth())

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enterprise Discussions related to GitHub Enterprise Cloud and Enterprise Server Product Feedback
2 participants