9856 fix plugin schema

This commit is contained in:
Arthur 2024-03-11 08:33:32 -07:00
parent ccc81e73d1
commit f960d5a482
2 changed files with 4 additions and 16 deletions

View File

@ -73,7 +73,7 @@ def register_graphql_schema(graphql_schema):
"""
Register a GraphQL schema class for inclusion in NetBox's GraphQL API.
"""
registry['plugins']['graphql_schemas'].append(graphql_schema)
registry['plugins']['graphql_schemas'].extend(graphql_schema)
def register_user_preferences(plugin_name, preferences):

View File

@ -14,7 +14,6 @@ class DummyModelType:
pass
"""
@strawberry.type
class DummyQuery:
@strawberry.field
@ -22,18 +21,7 @@ class DummyQuery:
return None
dummymodel_list: List[DummyModelType] = strawberry_django.field()
schema = strawberry.Schema(
query=DummyQuery,
# config=StrawberryConfig(auto_camel_case=False),
)
"""
@strawberry.type
class Query:
fruits: list[int] = strawberry_django.field()
schema2 = strawberry.Schema(
query=Query,
)
schema = [
DummyQuery,
]