GitHub GraphQL API does not follow GraphQL spec for some errors

If we try to use the GraphQL endpoint without a token, we receive the following response:

{'message': 'This endpoint requires you to be authenticated.', 'documentation_url': ''}

If we use an invalid token, we receive:

{'message': 'Bad credentials', 'documentation_url': ''}

In both cases, the answer does not follow the GraphQL spec which says:

If the operation encountered any errors, the response map must contain an entry with key errors

This can causes problems for GraphQL clients which are conforming to the spec and do not recognize the answer.
See issue python gql #149

Hello @leszekhanusz and welcome to the community.

Thanks for letting us know! The best place to submit feature requests and share more details about your use case is through our official product feedback form so that our product team can track your request.

Thanks again, we appreciate it.

This is done. Thanks for pointing me to the correct place.

1 Like

Hello @lee-dohm I am getting this same error message
{ message: 'This endpoint requires you to be authenticated.', documentation_url: '' }

but I used a token even generated a new token but still get the same message.

Did you forget to put "bearer " before the token ?

1 Like

No I didn’t, I forgot to put white space after “bearer” it’s sorted now. Thank you

1 Like

Thanks. This saved me.