From 81d99a00611f587882b5c1728fcc945b87421ba8 Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 4 Oct 2022 10:50:34 -0700 Subject: [PATCH] #10556 add display to GraphQL --- netbox/netbox/graphql/types.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/netbox/netbox/graphql/types.py b/netbox/netbox/graphql/types.py index 7d1b26f84..41eff6d46 100644 --- a/netbox/netbox/graphql/types.py +++ b/netbox/netbox/graphql/types.py @@ -1,3 +1,5 @@ +import graphene + from django.contrib.contenttypes.models import ContentType 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. """ + display = graphene.String() + + def resolve_display(parent, info, **kwargs): + return str(parent) + class Meta: abstract = True