Skip to content

Commit a1dd594

Browse files
committed
Update GraphQL type
1 parent 4dda9a5 commit a1dd594

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

netbox_lifecycle/graphql/types.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
ModuleType,
1212
)
1313
from virtualization.graphql.types import VirtualMachineType
14-
from netbox.graphql.types import NetBoxObjectType
14+
from netbox.graphql.types import PrimaryObjectType
1515
from .filters import *
1616

1717
from netbox_lifecycle import models
@@ -28,12 +28,12 @@
2828

2929

3030
@strawberry_django.type(models.Vendor, fields='__all__', filters=VendorFilter)
31-
class VendorType(NetBoxObjectType):
31+
class VendorType(PrimaryObjectType):
3232
name: str
3333

3434

3535
@strawberry_django.type(models.SupportSKU, fields='__all__', filters=SupportSKUFilter)
36-
class SupportSKUType(NetBoxObjectType):
36+
class SupportSKUType(PrimaryObjectType):
3737

3838
sku: str
3939
manufacturer: ManufacturerType
@@ -42,7 +42,7 @@ class SupportSKUType(NetBoxObjectType):
4242
@strawberry_django.type(
4343
models.SupportContract, fields='__all__', filters=SupportContractFilter
4444
)
45-
class SupportContractType(NetBoxObjectType):
45+
class SupportContractType(PrimaryObjectType):
4646

4747
vendor: VendorType
4848
contract_id: str
@@ -52,7 +52,7 @@ class SupportContractType(NetBoxObjectType):
5252

5353

5454
@strawberry_django.type(models.License, fields='__all__', filters=LicenseFilter)
55-
class LicenseType(NetBoxObjectType):
55+
class LicenseType(PrimaryObjectType):
5656

5757
manufacturer: ManufacturerType
5858
name: str
@@ -63,7 +63,7 @@ class LicenseType(NetBoxObjectType):
6363
fields='__all__',
6464
filters=SupportContractAssignmentFilter,
6565
)
66-
class SupportContractAssignmentType(NetBoxObjectType):
66+
class SupportContractAssignmentType(PrimaryObjectType):
6767
contract: SupportContractType
6868
sku: SupportSKUType | None
6969
device: DeviceType | None
@@ -76,7 +76,7 @@ class SupportContractAssignmentType(NetBoxObjectType):
7676
@strawberry_django.type(
7777
models.LicenseAssignment, fields='__all__', filters=LicenseAssignmentFilter
7878
)
79-
class LicenseAssignmentType(NetBoxObjectType):
79+
class LicenseAssignmentType(PrimaryObjectType):
8080
license: LicenseType
8181
vendor: VendorType
8282
device: DeviceType | None
@@ -87,7 +87,7 @@ class LicenseAssignmentType(NetBoxObjectType):
8787
@strawberry_django.type(
8888
models.HardwareLifecycle, fields='__all__', filters=HardwareLifecycleFilter
8989
)
90-
class HardwareLifecycleType(NetBoxObjectType):
90+
class HardwareLifecycleType(PrimaryObjectType):
9191
assigned_object_type: (
9292
Annotated["ContentTypeType", strawberry.lazy('netbox.graphql.types')] | None
9393
)

ruff.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
exclude = [
2-
'contrib'
2+
'.github',
3+
'contrib',
34
]
45
line-length = 120
56
target-version = "py310"

0 commit comments

Comments
 (0)