9856 test fixes

This commit is contained in:
Arthur 2024-03-06 15:25:06 -08:00
parent 77eb1018e8
commit 7c66a6aba8

View File

@ -1,21 +1,28 @@
import graphene from typing import List
from graphene_django import DjangoObjectType import strawberry
import strawberry_django
from netbox.graphql.fields import ObjectField, ObjectListField from strawberry.schema.config import StrawberryConfig
from . import models from . import models
class DummyModelType(DjangoObjectType): @strawberry_django.type(
models.DummyModel,
class Meta: fields='__all__',
model = models.DummyModel )
fields = '__all__' class DummyModelType:
pass
class DummyQuery(graphene.ObjectType): @strawberry.type
dummymodel = ObjectField(DummyModelType) class DummyQuery:
dummymodel_list = ObjectListField(DummyModelType) @strawberry.field
def dummymodel(self, id: int) -> DummyModelType:
return None
dummymodel_list: List[DummyModelType] = strawberry_django.field()
schema = DummyQuery schema = strawberry.Schema(
query=DummyQuery,
config=StrawberryConfig(auto_camel_case=False),
)