Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions backend/apps/github/api/internal/nodes/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ def author(self) -> UserNode | None:
"""Resolve author."""
return self.author

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.node_id

@strawberry.field
def organization_name(self) -> str | None:
"""Resolve organization name."""
Expand Down
5 changes: 5 additions & 0 deletions backend/apps/github/api/internal/nodes/milestone.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ def author(self) -> UserNode | None:
"""Resolve author."""
return self.author

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.node_id

@strawberry.field
def organization_name(self) -> str | None:
"""Resolve organization name."""
Expand Down
5 changes: 5 additions & 0 deletions backend/apps/github/api/internal/nodes/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class OrganizationStatsNode:
class OrganizationNode:
"""GitHub organization node."""

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.node_id

@strawberry.field
def stats(self) -> OrganizationStatsNode:
"""Resolve organization stats."""
Expand Down
5 changes: 5 additions & 0 deletions backend/apps/github/api/internal/nodes/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ def author(self) -> UserNode | None:
"""Resolve author."""
return self.author

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.node_id

@strawberry.field
def organization_name(self) -> str | None:
"""Resolve organization name."""
Expand Down
5 changes: 5 additions & 0 deletions backend/apps/github/api/internal/nodes/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def author(self) -> UserNode | None:
"""Resolve author."""
return self.author

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.node_id

@strawberry.field
def organization_name(self) -> str | None:
"""Resolve organization name."""
Expand Down
5 changes: 5 additions & 0 deletions backend/apps/github/api/internal/nodes/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
class RepositoryNode:
"""Repository node."""

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.node_id

@strawberry.field
def issues(self) -> list[IssueNode]:
"""Resolve recent issues."""
Expand Down
5 changes: 5 additions & 0 deletions backend/apps/owasp/api/internal/nodes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
class GenericEntityNode:
"""Base node class for OWASP entities with common fields and resolvers."""

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.key

@strawberry.field
def leaders(self) -> list[str]:
"""Resolve leaders."""
Expand Down
6 changes: 6 additions & 0 deletions backend/apps/owasp/api/internal/nodes/event.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""OWASP event GraphQL node."""

import strawberry
import strawberry_django

from apps.owasp.models.event import Event
Expand All @@ -21,3 +22,8 @@
)
class EventNode:
"""Event node."""

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.key
6 changes: 6 additions & 0 deletions backend/apps/owasp/api/internal/nodes/post.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""OWASP blog posts GraphQL nodes."""

import strawberry
import strawberry_django

from apps.owasp.models.post import Post
Expand All @@ -17,3 +18,8 @@
)
class PostNode:
"""Post node."""

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.id
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def created_at(self) -> datetime:
"""Resolve metrics creation date."""
return self.nest_created_at

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.id

@strawberry.field
def last_commit_days(self) -> int:
"""Resolve last commit age in days."""
Expand Down
6 changes: 6 additions & 0 deletions backend/apps/owasp/api/internal/nodes/sponsor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""OWASP sponsors GraphQL node."""

import strawberry
import strawberry_django

from apps.owasp.models.sponsor import Sponsor
Expand All @@ -16,3 +17,8 @@
)
class SponsorNode:
"""Sponsor node."""

@strawberry.field
def id(self) -> strawberry.ID:
"""Resolve a unique identifier."""
return self.key
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def test_issue_node_fields(self):
"title",
"url",
"author",
"id",
"organization_name",
"repository_name",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def test_milestone_node_fields(self):
"body",
"closed_issues_count",
"created_at",
"id",
"open_issues_count",
"organization_name",
"progress",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def test_meta_configuration(self):
"description",
"email",
"followers_count",
"id",
"location",
"login",
"name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def test_meta_configuration(self):
field_names = {field.name for field in ReleaseNode.__strawberry_definition__.fields}
expected_field_names = {
"author",
"id",
"is_pre_release",
"name",
"organization_name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_meta_configuration(self):
"stars_count",
"summary",
"type",
"id",
"issues_count",
"key",
"languages",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def test_meta_configuration(self):
"created_at",
"contributors_count",
"forks_count",
"id",
"is_funding_requirements_compliant",
"is_leader_requirements_compliant",
"last_commit_days",
Expand Down