I'm just trying to construct a query with multiple ordering fields (I'm using the django example btw).
Here's what I have right now ...
{
allCategories(orderBy: "name")
edges {
node {
id
name
slug
}
}
}
This works fine, but I like to order by multiple fields ...
allCategories(orderBy: "name, slug")
allCategories(orderBy: ["name", "slug"])
Am I using the wrong syntax or is this not even possible?
Graphene doesn't support that yet, it might be a good case to add!
@ivlevdenis helpful. "inherit" is very "beautiful" solutions, thank you so much.
I'm using this resolve function to handle a list of orderBy.
def resolve_all_users(self, info, **kwargs):
orderBy = kwargs.get("orderBy", None)
if orderBy:
return User.objects.order_by(*orderBy)
else:
return User.objects.all()
Looks like some workable solutions have been suggested for this issue. Closing
great solutions, thanks
Most helpful comment
Graphene doesn't support that yet, it might be a good case to add!