Skip to content

Commit

Permalink
Add status to manga graphql type
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirVondukr committed Feb 27, 2024
1 parent 29cbbc0 commit 90ea987
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/adapters/graphql/apps/manga/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from app.adapters.graphql.context import Info
from app.adapters.graphql.dto import DTOMixin
from app.adapters.graphql.types import LanguageGQL
from app.adapters.graphql.types import LanguageGQL, MangaStatusGQL
from app.core.domain.manga.loaders import MangaAltTitleLoader, MangaTagLoader
from app.db.models import Manga
from app.db.models._manga import AltTitle, MangaTag
Expand Down Expand Up @@ -50,6 +50,7 @@ class MangaGQL(DTOMixin[Manga]):
id: strawberry.ID
title: str
title_slug: str
status: MangaStatusGQL
created_at: datetime
updated_at: datetime

Expand All @@ -60,6 +61,7 @@ def from_dto(cls, model: Manga) -> Self:
id=strawberry.ID(str(model.id)),
title=model.title,
title_slug=model.title_slug,
status=model.status,
created_at=model.created_at,
updated_at=model.updated_at,
)
Expand Down
2 changes: 2 additions & 0 deletions tests/adapters/graphql/manga/queries/test_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
id
title
titleSlug
status
createdAt
updatedAt
}
Expand Down Expand Up @@ -55,6 +56,7 @@ async def test_manga(
"id": str(manga.id),
"title": manga.title,
"titleSlug": manga.title_slug,
"status": manga.status.name.upper(),
"createdAt": manga.created_at.isoformat(),
"updatedAt": manga.updated_at.isoformat(),
},
Expand Down

0 comments on commit 90ea987

Please sign in to comment.