So let's say, I have defined a field, project
using Graphene.Field
in my query. Now depending on the incoming query, the result may be a single project object or a list of proejct objects:
class Query(graphene.ObjectType):
project = graphene.Field(Project,..) # Project is a class defined elsewhere
def resolve_project(self, args, info):
# Implementation
How do I return a list of projects as response from my Flask-graphql application?
Just use graphene.List(Project, ...)
and it should work ;)