Как показать возможные поля OrderingFilter в проводнике документации graphql в graphene-django
У меня есть модель
class ProductOnRetailerOfOrganization(models.Model):
name = models.CharField(max_length=200, blank=True, null=True)
product_id = models.CharField(max_length=100, blank=true, null=true)
и узел graphql, например
class ProductNode(DjangoObjectType):
class Meta:
model = Product
interfaces = (graphene.relay.Node,)
connection_class = connections.ExtendedConnection
filterset_class = ProductFilter
And filterset
class ProductFilter(FilterSet):
class Meta:
model = Product
fields = {
"name": ["exact", "contains"],
"product_id": ["exact", "contains"],
}
order_by = OrderingFilter(
fields=(
(
"name",
"product_id",
)
)
)
и запрос, схема
import graphene
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import JsonResponse
from graphene_django.views import GraphQLView
class Query(graphene.ObjectType):
products = DjangoFilterConnectionField(nodes.ProductNode)
schema = graphene.Schema(query=Query)
class PrivateGraphQLView(LoginRequiredMixin, GraphQLView):
raise_exception = True
def introspection_schema_view(request):
data = {"data": schema.introspect()}
return JsonResponse(data)
когда я захожу в localhost:8000/graphql
Documentation Explorer, я не могу определить, какие поля могут быть переданы с аргументом orderBy. Он просто показывает orderBy: String!
в отличие от других полей фильтра, которые перечислены как точные аргументы поиска.
г. (nameIcontains: String !, name: String!)
Есть ли способ показать поля OrderingFilter так же, как показать фильтр и другие аргументы в проводнике документации?