Enable GraphQL API for Group Access Token
Release notes
Context
Thanks to &3055 (closed), we now have Group Access Token able to manipulate GitLab API.
Proposition
Have GAT working with GitLab GraphQL API
Problem to solve
Connection is not possible on GraphQL API with GAT
Successful on REST API
curl --header "PRIVATE-TOKEN: REDACTED" "https://gitlab.com/api/v4/user"
{"id":10711775,"username":"group_5105186_bot","name":"****","state":"active","avatar_url":"https://secure.gravatar.com/avatar/91e1b70e790170783d9aa7f75758b132?s=80\u0026d=identicon","web_url":"https://gitlab.com/group_5105186_bot","created_at":"2022-01-24T09:05:25.749Z","bio":"","location":null,"public_email":null,"skype":"","linkedin":"","twitter":"","website_url":"","organization":null,"job_title":"","pronouns":null,"bot":true,"work_information":null,"followers":0,"following":0,"local_time":null,"last_sign_in_at":null,"confirmed_at":"2022-01-24T09:05:25.722Z","last_activity_on":"2022-01-24","email":"group5105186_bot@noreply.gitlab.com","theme_id":1,"color_scheme_id":1,"projects_limit":100000,"current_sign_in_at":null,"identities":[],"can_create_group":true,"can_create_project":true,"two_factor_enabled":false,"external":false,"private_profile":false,"commit_email":"group5105186_bot@noreply.gitlab.com","shared_runners_minutes_limit":null,"extra_shared_runners_minutes_limit":null}
KO on GraphQL API
curl "https://gitlab.com/api/graphql" --header "Authorization: Bearer REDACTED" \
--header "Content-Type: application/json" --request POST \
--data "{\"query\": \"query {currentUser {name}}\"}"
{"data":{"currentUser":null}}
Proposal
GAT already create a bot user on group. This bot user should be able to connect GraphQL using GAT, the same way a user can connect using PAT.
Intended users
GitLab CI/CD obviously, great for things like Triage
Metrics
By usage of GAT
Edited by Thomas de Saint Exupery