From 431fa6adcc6f3ef06b646540636a31e5283ecbd1 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Mon, 22 Aug 2022 21:15:23 +0200 Subject: [PATCH] Fix a bug with GQL operations containing variables getting their defaults overwritten --- constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/constants.py b/constants.py index c13590c..a642368 100644 --- a/constants.py +++ b/constants.py @@ -2,8 +2,8 @@ from __future__ import annotations import sys import logging -from copy import copy from pathlib import Path +from copy import deepcopy from enum import Enum, auto from datetime import timedelta from typing import Any, Dict, Literal, NewType, TYPE_CHECKING @@ -106,7 +106,7 @@ class GQLOperation(JsonType): self.__setitem__("variables", variables) def with_variables(self, variables: JsonType) -> GQLOperation: - modified = copy(self) + modified = deepcopy(self) if "variables" in self: existing_variables: JsonType = modified["variables"] existing_variables.update(variables)