diff --git a/backend/apps/github/api/internal/nodes/issue.py b/backend/apps/github/api/internal/nodes/issue.py index 93eaf95a1f..4ac7eb7672 100644 --- a/backend/apps/github/api/internal/nodes/issue.py +++ b/backend/apps/github/api/internal/nodes/issue.py @@ -16,7 +16,7 @@ "url", ], ) -class IssueNode: +class IssueNode(strawberry.relay.Node): """GitHub issue node.""" @strawberry.field diff --git a/backend/apps/github/api/internal/nodes/milestone.py b/backend/apps/github/api/internal/nodes/milestone.py index 4ea537df8b..17b5d67f2c 100644 --- a/backend/apps/github/api/internal/nodes/milestone.py +++ b/backend/apps/github/api/internal/nodes/milestone.py @@ -19,7 +19,7 @@ "url", ], ) -class MilestoneNode: +class MilestoneNode(strawberry.relay.Node): """Github Milestone Node.""" @strawberry.field diff --git a/backend/apps/github/api/internal/nodes/organization.py b/backend/apps/github/api/internal/nodes/organization.py index 8656ef10ee..a249846bc7 100644 --- a/backend/apps/github/api/internal/nodes/organization.py +++ b/backend/apps/github/api/internal/nodes/organization.py @@ -36,7 +36,7 @@ class OrganizationStatsNode: "updated_at", ], ) -class OrganizationNode: +class OrganizationNode(strawberry.relay.Node): """GitHub organization node.""" @strawberry.field diff --git a/backend/apps/github/api/internal/nodes/pull_request.py b/backend/apps/github/api/internal/nodes/pull_request.py index f63d9ee7b0..8ac55e2221 100644 --- a/backend/apps/github/api/internal/nodes/pull_request.py +++ b/backend/apps/github/api/internal/nodes/pull_request.py @@ -14,7 +14,7 @@ "title", ], ) -class PullRequestNode: +class PullRequestNode(strawberry.relay.Node): """GitHub pull request node.""" @strawberry.field diff --git a/backend/apps/github/api/internal/nodes/release.py b/backend/apps/github/api/internal/nodes/release.py index e773843945..0bf8e78cdf 100644 --- a/backend/apps/github/api/internal/nodes/release.py +++ b/backend/apps/github/api/internal/nodes/release.py @@ -17,7 +17,7 @@ "tag_name", ], ) -class ReleaseNode: +class ReleaseNode(strawberry.relay.Node): """GitHub release node.""" @strawberry.field diff --git a/backend/apps/github/api/internal/nodes/repository.py b/backend/apps/github/api/internal/nodes/repository.py index c943e84055..4f784d27a8 100644 --- a/backend/apps/github/api/internal/nodes/repository.py +++ b/backend/apps/github/api/internal/nodes/repository.py @@ -37,7 +37,7 @@ "updated_at", ], ) -class RepositoryNode: +class RepositoryNode(strawberry.relay.Node): """Repository node.""" @strawberry.field diff --git a/backend/apps/nest/api/internal/nodes/api_key.py b/backend/apps/nest/api/internal/nodes/api_key.py index afe4859a2f..def42fc082 100644 --- a/backend/apps/nest/api/internal/nodes/api_key.py +++ b/backend/apps/nest/api/internal/nodes/api_key.py @@ -1,5 +1,6 @@ """GraphQL node for ApiKey model.""" +import strawberry import strawberry_django from apps.nest.models.api_key import ApiKey @@ -15,5 +16,5 @@ "uuid", ], ) -class ApiKeyNode: +class ApiKeyNode(strawberry.relay.Node): """GraphQL node for API keys.""" diff --git a/backend/apps/nest/api/internal/nodes/user.py b/backend/apps/nest/api/internal/nodes/user.py index 29dc7c9dc4..ab56a4f5c6 100644 --- a/backend/apps/nest/api/internal/nodes/user.py +++ b/backend/apps/nest/api/internal/nodes/user.py @@ -1,12 +1,13 @@ """GraphQL node for User model.""" +import strawberry import strawberry_django from apps.nest.models import User @strawberry_django.type(User, fields=["username"]) -class AuthUserNode: +class AuthUserNode(strawberry.relay.Node): """GraphQL node for User model.""" @strawberry_django.field diff --git a/backend/apps/owasp/api/internal/nodes/common.py b/backend/apps/owasp/api/internal/nodes/common.py index 798e07b269..902ed9dc2e 100644 --- a/backend/apps/owasp/api/internal/nodes/common.py +++ b/backend/apps/owasp/api/internal/nodes/common.py @@ -6,7 +6,7 @@ @strawberry.type -class GenericEntityNode: +class GenericEntityNode(strawberry.relay.Node): """Base node class for OWASP entities with common fields and resolvers.""" @strawberry.field diff --git a/backend/apps/owasp/api/internal/nodes/event.py b/backend/apps/owasp/api/internal/nodes/event.py index 999a1b6fe2..c2663ac705 100644 --- a/backend/apps/owasp/api/internal/nodes/event.py +++ b/backend/apps/owasp/api/internal/nodes/event.py @@ -1,5 +1,6 @@ """OWASP event GraphQL node.""" +import strawberry import strawberry_django from apps.owasp.models.event import Event @@ -19,5 +20,5 @@ "url", ], ) -class EventNode: +class EventNode(strawberry.relay.Node): """Event node.""" diff --git a/backend/apps/owasp/api/internal/nodes/post.py b/backend/apps/owasp/api/internal/nodes/post.py index 952434c101..54fef409fd 100644 --- a/backend/apps/owasp/api/internal/nodes/post.py +++ b/backend/apps/owasp/api/internal/nodes/post.py @@ -1,5 +1,6 @@ """OWASP blog posts GraphQL nodes.""" +import strawberry import strawberry_django from apps.owasp.models.post import Post @@ -15,5 +16,5 @@ "url", ], ) -class PostNode: +class PostNode(strawberry.relay.Node): """Post node.""" diff --git a/backend/apps/owasp/api/internal/nodes/sponsor.py b/backend/apps/owasp/api/internal/nodes/sponsor.py index e4bce1bad4..c66cb269b3 100644 --- a/backend/apps/owasp/api/internal/nodes/sponsor.py +++ b/backend/apps/owasp/api/internal/nodes/sponsor.py @@ -1,5 +1,6 @@ """OWASP sponsors GraphQL node.""" +import strawberry import strawberry_django from apps.owasp.models.sponsor import Sponsor @@ -14,5 +15,5 @@ "url", ], ) -class SponsorNode: +class SponsorNode(strawberry.relay.Node): """Sponsor node.""" diff --git a/backend/tests/apps/github/api/internal/nodes/issue_test.py b/backend/tests/apps/github/api/internal/nodes/issue_test.py index 0d211f1719..e33f315bf7 100644 --- a/backend/tests/apps/github/api/internal/nodes/issue_test.py +++ b/backend/tests/apps/github/api/internal/nodes/issue_test.py @@ -12,6 +12,7 @@ def test_issue_node_type(self): def test_issue_node_fields(self): field_names = {field.name for field in IssueNode.__strawberry_definition__.fields} expected_field_names = { + "_id", "created_at", "state", "title", diff --git a/backend/tests/apps/github/api/internal/nodes/milestone_test.py b/backend/tests/apps/github/api/internal/nodes/milestone_test.py index d027f85147..82e66128ec 100644 --- a/backend/tests/apps/github/api/internal/nodes/milestone_test.py +++ b/backend/tests/apps/github/api/internal/nodes/milestone_test.py @@ -12,6 +12,7 @@ def test_milestone_node_type(self): def test_milestone_node_fields(self): field_names = {field.name for field in MilestoneNode.__strawberry_definition__.fields} expected_field_names = { + "_id", "author", "body", "closed_issues_count", diff --git a/backend/tests/apps/github/api/internal/nodes/organization_test.py b/backend/tests/apps/github/api/internal/nodes/organization_test.py index a0f13d59d3..ce61947a7d 100644 --- a/backend/tests/apps/github/api/internal/nodes/organization_test.py +++ b/backend/tests/apps/github/api/internal/nodes/organization_test.py @@ -13,6 +13,7 @@ def test_organization_node_inheritance(self): def test_meta_configuration(self): field_names = {field.name for field in OrganizationNode.__strawberry_definition__.fields} expected_field_names = { + "_id", "avatar_url", "collaborators_count", "company", diff --git a/backend/tests/apps/github/api/internal/nodes/release_test.py b/backend/tests/apps/github/api/internal/nodes/release_test.py index f34f8b2277..91979d0878 100644 --- a/backend/tests/apps/github/api/internal/nodes/release_test.py +++ b/backend/tests/apps/github/api/internal/nodes/release_test.py @@ -13,6 +13,7 @@ def test_release_node_inheritance(self): def test_meta_configuration(self): field_names = {field.name for field in ReleaseNode.__strawberry_definition__.fields} expected_field_names = { + "_id", "author", "is_pre_release", "name", diff --git a/backend/tests/apps/github/api/internal/nodes/repository_test.py b/backend/tests/apps/github/api/internal/nodes/repository_test.py index 4504163046..b3129e4603 100644 --- a/backend/tests/apps/github/api/internal/nodes/repository_test.py +++ b/backend/tests/apps/github/api/internal/nodes/repository_test.py @@ -15,6 +15,7 @@ def test_project_node_inheritance(self): def test_meta_configuration(self): field_names = {field.name for field in ProjectNode.__strawberry_definition__.fields} expected_field_names = { + "_id", "contributors_count", "created_at", "forks_count", diff --git a/backend/tests/apps/nest/api/internal/nodes/api_keys_test.py b/backend/tests/apps/nest/api/internal/nodes/api_keys_test.py index 24b14ae5dd..764e85390c 100644 --- a/backend/tests/apps/nest/api/internal/nodes/api_keys_test.py +++ b/backend/tests/apps/nest/api/internal/nodes/api_keys_test.py @@ -14,6 +14,7 @@ def test_api_key_node_configuration(self): defined_fields = {f.name for f in ApiKeyNode.__strawberry_definition__.fields} expected_fields = { + "_id", "created_at", "expires_at", "is_revoked", diff --git a/backend/tests/apps/nest/api/internal/nodes/user_test.py b/backend/tests/apps/nest/api/internal/nodes/user_test.py index e871441640..1ae4ef0fc7 100644 --- a/backend/tests/apps/nest/api/internal/nodes/user_test.py +++ b/backend/tests/apps/nest/api/internal/nodes/user_test.py @@ -9,7 +9,7 @@ def test_auth_user_node_configuration(self): assert AuthUserNode.__strawberry_definition__.name == "AuthUserNode" fields = {f.name: f for f in AuthUserNode.__strawberry_definition__.fields} - assert set(fields.keys()) == {"is_owasp_staff", "username"} + assert set(fields.keys()) == {"_id", "is_owasp_staff", "username"} username_field = fields["username"] is_owasp_staff_field = fields["is_owasp_staff"]