lablup / lablup/backend.ai

Apply BackendAIAPIMeta to Strawberry GraphQL schema

Open
#7,818 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

## Motivation

Apply `BackendAIAPIMeta` annotations to Strawberry GraphQL types and inputs for consistent documentation and version tracking.

## Scope

Update files in:

- `src/ai/backend/manager/api/gql/*.py`
- `src/ai/backend/manager/models/gql_models/*.py`

Apply metadata pattern:

```python
@strawberry.input
class CreateSessionInput:
name: Annotated[
str,
BackendAIAPIMeta(
description="Session name.",
added_version="25.1.0",
example="my-session",
),
]

@strawberry.type
class SessionNode:
id: Annotated[
str,
BackendAIAPIMeta(
description="Session unique identifier.",
added_version="25.1.0",
example="sess-12345",
),
]
```

## Additional Tasks

- Create custom Strawberry extension to read description from Meta
- Auto-reflect description and deprecation info during GraphQL schema generation

## Acceptance Criteria

- All GraphQL types annotated with BackendAIAPIMeta
- GraphQL schema reflects metadata descriptions
- Deprecated fields marked in schema

## Dependencies

- BA-3784 (metadata classes implementation)

## References

- [BEP-1022: Pydantic Field Metadata Annotation](https://github.com/lablup/backend.ai/blob/main/proposals/BEP-1022-pydantic-field-annotations.md) Phase 4

JIRA Issue: BA-3788

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.