mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Add GraphQL for users and groups
This commit is contained in:
@@ -33,6 +33,9 @@ def get_graphql_type_for_model(model):
|
||||
Return the GraphQL type class for the given model.
|
||||
"""
|
||||
app_name, model_name = model._meta.label.split('.')
|
||||
# Object types for Django's auth models are in the users app
|
||||
if app_name == 'auth':
|
||||
app_name = 'users'
|
||||
class_name = f'{app_name}.graphql.types.{model_name}Type'
|
||||
try:
|
||||
return dynamic_import(class_name)
|
||||
|
Reference in New Issue
Block a user