Skip to main content

XGIC GitLab GraphQL Client

License CI PyPI Python Release

XGIC GitLab GraphQL Client (xgic-gitlab-graphql) — a clean, extensible, Python-first client for GitLab’s GraphQL API (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

  • Official 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 import a 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

Primary path for Grok Build and all consumers — install the published package from PyPI:

uv pip install xgic-gitlab-graphql
# pin the package used for automation (e.g. post-upgrade validation):
uv pip install "xgic-gitlab-graphql==0.1.2"

Index: https://pypi.org/project/xgic-gitlab-graphql/

Development (editable)

Editable installs are for working on this repository only (not the default for agents or production automation):

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.

Compatibility

See docs/COMPATIBILITY.md for:

  • Minimum supported version = GitLab EE (aligned with GitLab’s maintenance policy; set to the current stable EE version after successful validation with PyPI client 0.1.2)
  • Client package pins (e.g. 0.1.2 for validation / automation) vs GitLab EE support floor
  • Policy: do not ship client changes solely to support outdated self-managed EE pins

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

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.

Release files for xgic-gitlab-graphql 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xgic-gitlab-graphql 0.1.3
File Size Uploaded
xgic_gitlab_graphql-0.1.3.tar.gz 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xgic-gitlab-graphql 0.1.3
File Interpreter ABI Platform
xgic_gitlab_graphql-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 46.5 kB

Release files / xgic_gitlab_graphql-0.1.3.tar.gz

Download URL xgic_gitlab_graphql-0.1.3.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d677fbccfa1a9b87bc00b9cd161d28337c9824c84313bd8f495ec18b665ce5f7
BLAKE2b-256 checksum
How to use checksums
b4092fa900814e54abc18507f9dc3d95892bd8eccab7ad6395f91225128af252
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.

Transparency log

Release files / xgic_gitlab_graphql-0.1.3-py3-none-any.whl

Download URL xgic_gitlab_graphql-0.1.3-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d90fe3c9fc8b1fc69ec50627d4a0ba1cd1cc60fe4cc8bfe5d669b7df73dca7a2
BLAKE2b-256 checksum
How to use checksums
a89c08f31977c69d6f25107277c578de0fc64c3ace0dfdce2f6b8fb14d35aeb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.4

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page