GraphQL project token does not have access to project
Summary
Query for a project returns null when trying to use project token
Query
query { project(fullPath: "projectName") { name }}
Expected
{ data: { project: { name: "projectName" }}}
Actual
{ data: { project: null }}
What works
- REST API, no problems using a Private-Token header with a project token and my own personal token.
- CURL, using personal token with cURL using an "Authentication: Bearer" header.
- GraphQL, personal token, with the Private-Token OR Authorization header, I can fetch issues without problem.
What doesn't work
- If I try to use a project token, with the Private-Token OR Authorization header, to fetch issues with cURL or a node http request, the return result is
data {project: null}}
basic cURL command used: curl 'url' --header "Authorization: Bearer xxxxxx" --header "Content-Type: application/json" --request POST -d '{"query": "query($path: ID!) {project(fullPath: $path){name}}", "variables": {"path": "adb/flow/flowApp"}}'
When testing, the only thing I did was replace the token. Otherwise, it was the same command.
Gitlab version: 13.2.1-ee (I know we are behind. I have no control over that though and I can't find a bug report on this issue, so if this is fixed in a newer version, my apologies)
Edited by Rob Kotenko