Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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/src/apps/mentorship/api/internal/nodes/admin.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
"""GraphQL node for Admin model."""

from typing import TYPE_CHECKING

import strawberry

if TYPE_CHECKING:
from apps.github.models.user import User as GitHubUser

@strawberry.type
class AdminNode:
"""A GraphQL node representing a mentorship admin."""

id: strawberry.ID
github_user: GitHubUser | None
Comment thread
Tanishq-mellu marked this conversation as resolved.
Comment thread
Tanishq-mellu marked this conversation as resolved.

@strawberry.field(name="avatarUrl")
def avatar_url(self) -> str:
Expand Down
6 changes: 5 additions & 1 deletion backend/src/apps/mentorship/api/internal/nodes/mentor.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
"""GraphQL node for Mentor model."""

from typing import TYPE_CHECKING

import strawberry

if TYPE_CHECKING:
from apps.github.models.user import User as GitHubUser

@strawberry.type
class MentorNode:
"""A GraphQL node representing a mentorship mentor."""

id: strawberry.ID

github_user: GitHubUser | None
Comment thread
Tanishq-mellu marked this conversation as resolved.
Comment thread
Tanishq-mellu marked this conversation as resolved.
Comment thread
Tanishq-mellu marked this conversation as resolved.
@strawberry.field
def avatar_url(self) -> str:
"""Get the GitHub avatar URL of the mentor."""
Expand Down
7 changes: 6 additions & 1 deletion backend/src/apps/nest/api/internal/nodes/user.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
"""GraphQL node for User model."""

from typing import TYPE_CHECKING

import strawberry
import strawberry_django

from apps.nest.models import User


if TYPE_CHECKING:
from apps.github.models.user import User as GitHubUser

@strawberry_django.type(User, fields=["username"])
class AuthUserNode(strawberry.relay.Node):
"""GraphQL node for User model."""
github_user: GitHubUser | None
Comment thread
Tanishq-mellu marked this conversation as resolved.

@strawberry_django.field
def is_owasp_staff(self) -> bool:
Expand Down