When using the following schema I keep getting null values when querying for products. From my understanding of the documentation, it should return an array with 2 objects containing id and name. Can anyone help me to understand why the following code does not work?
import graphene class Product(graphene.ObjectType): id = graphene.Int() name = graphene.String() class Query(graphene.ObjectType): products = graphene.List(Product) def resolve_products(self, info, **kwargs): return [{ "name": "TEST", "id": 1 }, { "name": "TEST2", "id": 2 }] schema = graphene.Schema(query=Query)
resolve_productsmethod is returning a list of dictionaries, not a list ofProduct