mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
16244 fix order_by pagination
This commit is contained in:
parent
0754c85715
commit
afcba91931
@ -1,7 +1,9 @@
|
||||
import strawberry
|
||||
from django.conf import settings
|
||||
# from django.db.models.manager import BaseManager
|
||||
# from django.db.models.query import QuerySet
|
||||
from strawberry_django.optimizer import DjangoOptimizerExtension
|
||||
from strawberry.extensions import MaxAliasesLimiter
|
||||
from strawberry.extensions import MaxAliasesLimiter # , SchemaExtension
|
||||
from strawberry.schema.config import StrawberryConfig
|
||||
|
||||
from circuits.graphql.schema import CircuitsQuery
|
||||
@ -12,11 +14,28 @@ from ipam.graphql.schema import IPAMQuery
|
||||
from netbox.registry import registry
|
||||
from tenancy.graphql.schema import TenancyQuery
|
||||
from users.graphql.schema import UsersQuery
|
||||
# from utilities.query import reapply_model_ordering
|
||||
from virtualization.graphql.schema import VirtualizationQuery
|
||||
from vpn.graphql.schema import VPNQuery
|
||||
from wireless.graphql.schema import WirelessQuery
|
||||
|
||||
|
||||
"""
|
||||
class ModelOrderingExtension(SchemaExtension):
|
||||
|
||||
def resolve(self, next_, root, info, *args, **kwargs):
|
||||
ret = next_(root, info, *args, **kwargs)
|
||||
|
||||
if isinstance(ret, BaseManager):
|
||||
ret = ret.all()
|
||||
|
||||
if isinstance(ret, QuerySet) and ret._result_cache is None: # type: ignore
|
||||
ret = reapply_model_ordering(ret)
|
||||
|
||||
return ret
|
||||
"""
|
||||
|
||||
|
||||
@strawberry.type
|
||||
class Query(
|
||||
UsersQuery,
|
||||
|
Loading…
Reference in New Issue
Block a user