create-draft-fix
All checks were successful
Deploy on push / deploy (push) Successful in 1m47s

This commit is contained in:
Untone 2025-02-27 16:16:41 +03:00
parent 8cd0c8ea4c
commit 20eba36c65
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#### [0.4.11] - 2025-02-12
- `create_draft` resolver requires draft_id fixed
- `create_draft` resolver defaults body field to empty string
- `create_draft` resolver defaults body and title fields to empty string
#### [0.4.9] - 2025-02-09

View File

@ -67,7 +67,7 @@ async def create_draft(_, info, draft_input):
Args:
info: GraphQL context
draft_input (dict): Draft data including optional fields:
- title (str)
- title (str, required) - заголовок черновика
- body (str, required) - текст черновика
- slug (str)
- etc.
@ -96,6 +96,9 @@ async def create_draft(_, info, draft_input):
# Проверяем обязательные поля
if "body" not in draft_input or not draft_input["body"]:
draft_input["body"] = "" # Пустая строка вместо NULL
if "title" not in draft_input or not draft_input["title"]:
draft_input["title"] = "" # Пустая строка вместо NULL
try:
with local_session() as session: