XGIC GitLab GraphQL Client — A high-level, extensible Python client for GitLab's GraphQL API with first-class support for Work Items, hierarchical Tasks, Merge Requests, and automation use cases (including Grok Build).
Project description
XGIC GitLab GraphQL Client (xgic-gitlab-graphql)
The official XGIC GitLab GraphQL Client — a clean, extensible, Python-first client for GitLab’s GraphQL API (Python namespace: xgic.gitlab.graphql).
Goal: Replace fragile CLI-based automation (glab) with a reliable, strongly-typed Python library that Grok Build (and humans) can use comfortably. Start with Issues + child Tasks (proper Work Item hierarchy), Merge Requests, Labels, Milestones, and Releases. Designed from day one to grow into full GraphQL coverage and structured data (estimates, actuals, etc.).
Why This Exists
- GitLab CLI escaping problems with long descriptions and complex content
- Need for real hierarchical Tasks instead of Markdown checklists
- Desire to move work data into structured, queryable fields
- Grok Build works best when it can simply
importa well-designed Python library
Key Features (Phase 1)
- High-level methods:
create_issue(),create_task(parent_id),create_issue_with_tasks()(create_merge_request() is a placeholder stub) - Proper parent-child Task hierarchy via GitLab Work Items
- Clean data models (
Issue,Task,MergeRequest) instead of raw dicts - Centralized error handling and GraphQL execution
- Minimal dependencies (just
requests) - Cross-platform (Windows + Linux)
- Easy to install and reuse across projects
Installation
From PyPI (after publish; preferred for consumers):
uv venv
uv pip install xgic-gitlab-graphql
Development (editable):
git clone https://github.com/xgic/gitlab-graphql.git
cd gitlab-graphql
uv pip install -e ".[dev]"
Python 3.14+ required. Build/smoke with uv. Official releases use OIDC Trusted Publishing (python-package-release.md). No Makefiles.
Quick Start (Python)
from xgic.gitlab.graphql import GitLabClient
client = GitLabClient(
token="glpat-xxxxxxxxxxxxxxxxxxxx",
url="https://gitlab.com" # or your self-hosted instance
)
# Create a parent issue
issue = client.create_issue(
title="Implement new reporting feature",
description="High-level description here...",
namespace_path="group/project",
labels=["feature", "backend"],
)
# Create child tasks under it
task1 = client.create_task(
parent_id=issue.id,
title="Design database schema",
description="...",
namespace_path="group/project",
)
task2 = client.create_task(
parent_id=issue.id,
title="Implement API endpoints",
namespace_path="group/project",
)
print(f"Issue created: {issue.web_url}")
print(f"Tasks created under it.")
Recommended for Grok Build: Use the convenience method create_issue_with_tasks(...) whenever possible.
Project Structure
See docs/ARCHITECTURE.md and docs/development-workflow.md for layout and responsibilities.
Documentation
- docs/ADR-001-GitLab-GraphQL-Client.md
- docs/ARCHITECTURE.md
- docs/BASE-STANDARDS-FOR-ORCHESTRATED-REPOS.md
- docs/development-workflow.md
- docs/grok-playbooks.md
- docs/GROK_BUILD_INTEGRATION.md
Engineering Tooling Philosophy
- Build backend: hatchling (namespace packages, uv)
- Environment / packaging: uv + pip
- Linting / formatting: ruff (Google docstrings)
- Type checking: pyright (strict)
- Testing: pytest
- Primary interface: Python library (import, not CLI)
Follows XGIC CLI standard + no Makefiles noted throughout.
Status
Core client implemented (auth, queries/mutations for work items hierarchy + pagination, models, common queries). Base standards in place. Phase 1 complete for initial use cases.
See CHANGELOG.md for details.
Multi-repo standards
Portfolio standards, ADRs, and community health:
License
Copyright 2026 XGIC.
Licensed under the Apache License, Version 2.0.
See NOTICE.
Contributing
See CONTRIBUTING.md. Use GitHub Flow: issue-named branches, Conventional Commits, human review in the GitHub UI before merge to main.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xgic_gitlab_graphql-0.1.2.tar.gz.
File metadata
- Download URL: xgic_gitlab_graphql-0.1.2.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f78f97403d176de279cbdbcf150002333c283b5c33d258299645b568e740746
|
|
| MD5 |
5ec76bd6a09995a43f653fa278db857c
|
|
| BLAKE2b-256 |
3db51f9e31f442fe56a72c6b540b1fd3e047f0ec7c8da6954d9ae6a4d8cb26d4
|
Provenance
The following attestation bundles were made for xgic_gitlab_graphql-0.1.2.tar.gz:
Publisher:
release.yml on xgic/gitlab-graphql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xgic_gitlab_graphql-0.1.2.tar.gz -
Subject digest:
1f78f97403d176de279cbdbcf150002333c283b5c33d258299645b568e740746 - Sigstore transparency entry: 2203128551
- Sigstore integration time:
-
Permalink:
xgic/gitlab-graphql@ecc7e0710d31fedb0cbc6c68d2f72f44208c60b1 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/xgic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ecc7e0710d31fedb0cbc6c68d2f72f44208c60b1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xgic_gitlab_graphql-0.1.2-py3-none-any.whl.
File metadata
- Download URL: xgic_gitlab_graphql-0.1.2-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6afc04c97e01d218b3f0223d7796941b2accd4b34fa5b46e510da3540df1b2d
|
|
| MD5 |
d1991e17eec7774cb640acd718b13125
|
|
| BLAKE2b-256 |
d45c1f84a0964ff98ecb79b28c2c4d2bec7a5acc9e7e27029e2da91bf7d6325b
|
Provenance
The following attestation bundles were made for xgic_gitlab_graphql-0.1.2-py3-none-any.whl:
Publisher:
release.yml on xgic/gitlab-graphql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xgic_gitlab_graphql-0.1.2-py3-none-any.whl -
Subject digest:
b6afc04c97e01d218b3f0223d7796941b2accd4b34fa5b46e510da3540df1b2d - Sigstore transparency entry: 2203128596
- Sigstore integration time:
-
Permalink:
xgic/gitlab-graphql@ecc7e0710d31fedb0cbc6c68d2f72f44208c60b1 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/xgic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ecc7e0710d31fedb0cbc6c68d2f72f44208c60b1 -
Trigger Event:
push
-
Statement type: