1
0
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:
jeremystretch
2021-06-29 13:15:10 -04:00
parent ef3cb9544a
commit 05ba54b6d3
6 changed files with 56 additions and 2 deletions

View File

@@ -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)