mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-19 09:53:34 -06:00
Merge pull request #10557 from netbox-community/10556-graphql-display
#10556 add display to GraphQL
This commit is contained in:
commit
a1cc15a604
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user