From bbde0a46549549c4bcf43b8ec3193068ae9262dd Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Wed, 30 Apr 2025 00:37:09 +0300 Subject: [PATCH] Update `PostType` and `PostTagType` field definitions Replaced `fields = "__all__"` with specific fields for better control and security. Removed unused `filter_fields` to clean up the code and align with actual requirements. These changes improve maintainability and clarity. --- blog/graphene/object_types.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/blog/graphene/object_types.py b/blog/graphene/object_types.py index b2301a6b..4a5b7680 100644 --- a/blog/graphene/object_types.py +++ b/blog/graphene/object_types.py @@ -11,9 +11,8 @@ class PostType(DjangoObjectType): class Meta: model = Post - fields = "__all__" + fields = ["tags", "content", "title", "slug"] interfaces = (relay.Node,) - filter_fields = ["is_active"] def resolve_content(self, info): return self.content.html.replace("\n", "
") @@ -24,4 +23,3 @@ class PostTagType(DjangoObjectType): model = PostTag fields = "__all__" interfaces = (relay.Node,) - filter_fields = ["is_active"]