2024-10-02 20:38:15 发布
网友
class ProductQuery(graphene.ObjectType): products = graphene.List(Product) def resolve_products(self, info): return get_all_products()
以上是我的代码查询所有产品没有参数。我想按制造商编号查询产品是什么?如何做解析器?在
their official site上没有文档。在
class ProductQuery(graphene.ObjectType): products = graphene.List(Product, id=graphene.Int()) def resolve_products(self, info, id): return Product.objects.filter(manufacture_id__exact=id)
相关问题 更多 >
编程相关推荐