Skip to content

Add basic GraphQL interface in client

This change set adds an experimental GraphQL interface in the client-go Client object. It doesn't use any third-party GraphQL packages nor does it make use of the GraphQL schema for any dynamic shenanigans. This is simple first iteration to re-use the existing GitLab client and to emit a GraphQL query.

It can be used like this:

    var response struct {
    	Data struct {
    		Project struct {
    			ID string `json:"id"`
    		} `json:"project"`
    	} `json:"data"`
    }
    resp, err := client.GraphQL.Do(context.Background(), GraphQLQuery{Query: `query { project(fullPath: "gitlab-org/gitlab") { id } }`}, &response)

Refs #2107 (closed)

Changelog: added

Merge request reports

Loading