#10556 add display to GraphQL

This commit is contained in:
Arthur 2022-10-04 10:50:34 -07:00
parent 568e0c7ff6
commit 81d99a0061

View File

@ -1,3 +1,5 @@
import graphene
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from graphene_django import DjangoObjectType from graphene_django import DjangoObjectType
@ -19,6 +21,11 @@ class BaseObjectType(DjangoObjectType):
""" """
Base GraphQL object type for all NetBox objects. Restricts the model queryset to enforce object permissions. Base GraphQL object type for all NetBox objects. Restricts the model queryset to enforce object permissions.
""" """
display = graphene.String()
def resolve_display(parent, info, **kwargs):
return str(parent)
class Meta: class Meta:
abstract = True abstract = True