mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Initial work on GraphQL
This commit is contained in:
21
netbox/extras/tests/dummy_plugin/graphql.py
Normal file
21
netbox/extras/tests/dummy_plugin/graphql.py
Normal file
@ -0,0 +1,21 @@
|
||||
import graphene
|
||||
from graphene_django import DjangoObjectType
|
||||
|
||||
from netbox.graphql.fields import ObjectField, ObjectListField
|
||||
|
||||
from . import models
|
||||
|
||||
|
||||
class DummyModelType(DjangoObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.DummyModel
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class DummyQuery(graphene.ObjectType):
|
||||
dummymodel = ObjectField(DummyModelType)
|
||||
dummymodel_list = ObjectListField(DummyModelType)
|
||||
|
||||
|
||||
schema = DummyQuery
|
Reference in New Issue
Block a user