Скажем, у меня есть что-то:
class FooType(DjangoObjectType):
class Meta:
model = Foo
fields = (
“one”,
“Two”,
)
class SomeQuery(graphene.ObjectType):
some_field = graphene.List(
FooType,
input_stream=graphene.String(),
description="json dump of filters containing key value pairs.")
@staticmethod
def resolve_some_field(info, input_stream):
some_lists = load_this(input_stream)
queryset = functools.reduce(
lambda f_1, f_2: f_1 | f_2,
get_from_list(some_lists))
return queryset.all()
class ABCFilter(django_filters.FilterSet):
name = django_filters.CharFilter(field_name="name",
lookup_expr="icontains")
# is it possible to filter on query from SomeQuery? Over here?
class ABCNode(DjangoObjectType):
class Meta:
model = models.ABCModel
interfaces = (relay.Node, )
filterset_class = ABCFilter
class Query(SomeQuery, graphene.ObjectType):
abc = relay.Node.Field(ABCNode)
all_abc = DjangoFilterConnectionField(ABCNode)
OR add as a query field here?
Я хотел бы добавить SomeQuery
в ABCFilter или каким-то образом добавить его в ABCNode, чтобы я мог запросить схему и параметры передачи в some_field