Skip to content

Commit e35381d

Browse files
committed
refactor(graphql): Reorder types to match model hierarchy
Reordered GraphQL classes to follow the structure of their corresponding NetBox models, improving consistency and maintainability. Fixes: #249
1 parent 76cd0c4 commit e35381d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

netbox_acls/graphql/types.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,31 @@ class ACLInterfaceAssignmentType(NetBoxObjectType):
5656

5757

5858
@strawberry_django.type(
59-
models.ACLExtendedRule,
59+
models.ACLStandardRule,
6060
fields="__all__",
61-
filters=filters.ACLExtendedRuleFilter,
61+
filters=filters.ACLStandardRuleFilter,
6262
)
63-
class ACLExtendedRuleType(NetBoxObjectType):
63+
class ACLStandardRuleType(NetBoxObjectType):
6464
"""
65-
Defines the object type for the django model ACLExtendedRule.
65+
Defines the object type for the django model ACLStandardRule.
6666
"""
6767

68-
source_ports: List[int]
69-
destination_ports: List[int]
7068
access_list: Annotated["AccessListType", strawberry.lazy("netbox_acls.graphql.types")]
71-
destination_prefix: Annotated["PrefixType", strawberry.lazy("ipam.graphql.types")]
7269
source_prefix: Annotated["PrefixType", strawberry.lazy("ipam.graphql.types")]
7370

7471

7572
@strawberry_django.type(
76-
models.ACLStandardRule,
73+
models.ACLExtendedRule,
7774
fields="__all__",
78-
filters=filters.ACLStandardRuleFilter,
75+
filters=filters.ACLExtendedRuleFilter,
7976
)
80-
class ACLStandardRuleType(NetBoxObjectType):
77+
class ACLExtendedRuleType(NetBoxObjectType):
8178
"""
82-
Defines the object type for the django model ACLStandardRule.
79+
Defines the object type for the django model ACLExtendedRule.
8380
"""
8481

8582
access_list: Annotated["AccessListType", strawberry.lazy("netbox_acls.graphql.types")]
8683
source_prefix: Annotated["PrefixType", strawberry.lazy("ipam.graphql.types")]
84+
source_ports: List[int]
85+
destination_prefix: Annotated["PrefixType", strawberry.lazy("ipam.graphql.types")]
86+
destination_ports: List[int]

0 commit comments

Comments
 (0)