Open blueforesticarus opened 3 years ago
Okay, I completely missed that "Query" was the class name.
Either way I think this error message is pretty unhelpful. For example, I get the exact same thing with:
class GQL_Free(graphene.Mutation):
class Arguments:
id = graphene.ID()
histo = GQL_Histo()
def mutate(id):
h = histograms[id]
h.free()
return GQL_Free(histo=h)
AssertionError: GQL_Free fields must be a mapping (dict / OrderedDict) with field names as keys or a function which returns such a mapping.
When creating a schema, if there is a problem with one of your QueryObjects, the resulting error message and traceback does not give any indication as to which ObjectType class is broken.
ex)
In the error there should at least be the name of the Query class whose fields are invalid. In this case I believe the error turned out to be that the root Query had no fields because I was improperly dynamically generating them.