Revert "Add UpdateGameMutation"

This reverts commit e9e61403a9.
This commit is contained in:
Lukáš Kucharczyk 2023-11-29 21:17:41 +01:00
parent e9e61403a9
commit 63c70d4b31
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 1 additions and 26 deletions

View File

@ -15,27 +15,6 @@ class Game(DjangoObjectType):
fields = "__all__"
class UpdateGameMutation(graphene.Mutation):
class Arguments:
id = graphene.ID(required=True)
name = graphene.String()
year_released = graphene.Int()
wikidata = graphene.String()
game = graphene.Field(Game)
def mutate(self, info, id, name=None, year_released=None, wikidata=None):
game_instance = GameModel.objects.get(pk=id)
if name is not None:
game_instance.name = name
if year_released is not None:
game_instance.year_released = year_released
if wikidata is not None:
game_instance.wikidata = wikidata
game_instance.save()
return UpdateGameMutation(game=game_instance)
class Edition(DjangoObjectType):
class Meta:
model = EditionModel
@ -100,8 +79,4 @@ class Query(graphene.ObjectType):
return DeviceModel.objects.all()
class Mutation(graphene.ObjectType):
update_game = UpdateGameMutation.Field()
schema = graphene.Schema(query=Query, mutation=Mutation)
schema = graphene.Schema(query=Query)