mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-18 00:19:15 +00:00
c6919293b6
I've learned that there is no problem in grouping mutations like we do with queries. This is a big mistake from my side, now we have legacy not so conveniently placed endpoints. I've grouped all mutations, left the copies of old ones flattened in the root for backwards compatibility. We will migrate to mutation groups on client side, and backups now only use grouped mutations. Tests are updated.
22 lines
396 B
Python
22 lines
396 B
Python
import strawberry
|
|
import typing
|
|
|
|
from selfprivacy_api.graphql.common_types.jobs import ApiJob
|
|
|
|
|
|
@strawberry.interface
|
|
class MutationReturnInterface:
|
|
success: bool
|
|
message: str
|
|
code: int
|
|
|
|
|
|
@strawberry.type
|
|
class GenericMutationReturn(MutationReturnInterface):
|
|
pass
|
|
|
|
|
|
@strawberry.type
|
|
class GenericJobMutationReturn(MutationReturnInterface):
|
|
job: typing.Optional[ApiJob] = None
|