Skip to content
Merged
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
14 changes: 5 additions & 9 deletions netbox/users/graphql/types.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from typing import List

import strawberry
import strawberry_django
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from strawberry import auto
from users import filtersets

from netbox.graphql.types import BaseObjectType
from users.models import Group
from utilities.querysets import RestrictedQuerySet
from .filters import *

__all__ = (
Expand All @@ -21,17 +18,16 @@
fields=['id', 'name'],
filters=GroupFilter
)
class GroupType:
class GroupType(BaseObjectType):
pass


@strawberry_django.type(
get_user_model(),
fields=[
'id', 'username', 'password', 'first_name', 'last_name', 'email', 'is_staff',
'is_active', 'date_joined', 'groups',
'id', 'username', 'first_name', 'last_name', 'email', 'is_staff', 'is_active', 'date_joined', 'groups',
],
filters=UserFilter
)
class UserType:
class UserType(BaseObjectType):
groups: List[GroupType]