GitLab GraphQL API

Gitlab

GitLab is DevOps software that combines the ability to develop, secure, and operate software in a single application. It offers a GraphQL API which we can join with Hasura using Remote Schemas.

Adding Gitlab as a Remote Schema

  1. Create a Gitlab personal access token, for this example we'll give it the read_api scope.

  2. Add the token as an environment variable in Hasura in the form of bearer <your personal access token>

  3. In the Hasura Console, go to Remote Schemas and add the Gitlab API

    • The GraphQL Server URL is https://gitlab.com/api/graphql
    • Add the Authorization header from the environment variable you created earlier
  4. Test by querying the token user

    {
      currentUser {
        name
      }
    }
    
SPECS
Released: June 10, 2021
Developed by: GitLab
Category: Data Services