You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classPerson(MongoengineObjectType):
classMeta:
model=PersonModel# no interface, since I want to access the people directlyclassHouse(MongoengineObjectType):
classMeta:
model=HouseModelinterfaces= (Node,)
Traceback (most recent call last):
File "test.py", line 32, in <module>
schema = graphene.Schema(query=Query, types=[House, Person])
File "%python39%\lib\site-packages\graphene\types\schema.py", line 78, in __init__
self.build_typemap()
File "%python39%\lib\site-packages\graphene\types\schema.py", line 167, in build_typemap
self._type_map = TypeMap(
File "%python39%\lib\site-packages\graphene\types\typemap.py", line 80, in __init__
super(TypeMap, self).__init__(types)
File "%python39%\lib\site-packages\graphql\type\typemap.py", line 31, in __init__
self.update(reduce(self.reducer, types, OrderedDict())) # type: ignore
File "%python39%\lib\site-packages\graphene\types\typemap.py", line 88, in reducer
return self.graphene_reducer(map, type)
File "%python39%\lib\site-packages\graphene\types\typemap.py", line 117, in graphene_reducer
return GraphQLTypeMap.reducer(map, internal_type)
File "%python39%\lib\site-packages\graphql\type\typemap.py", line 109, in reducer
field_map = type_.fields
File "%python39%\lib\site-packages\graphql\pyutils\cached_property.py", line 22, in __get__
value = obj.__dict__[self.func.__name__] = self.func(obj)
File "%python39%\lib\site-packages\graphql\type\definition.py", line 198, in fields
return define_field_map(self, self._fields)
File "%python39%\lib\site-packages\graphql\type\definition.py", line 212, in define_field_map
field_map = field_map()
File "%python39%\lib\site-packages\graphene\types\typemap.py", line 286, in construct_fields_for_type
for arg_name, arg in field.args.items():
File "%python39%\lib\site-packages\graphene_mongo\fields.py", line 68, in args
return to_arguments(
File "%python%\lib\site-packages\graphene\types\argument.py", line 80, in to_arguments
extra_args = sorted(extra_args.items(), key=lambda f: f[1])
TypeError: '<' not supported between instances of 'Person' and 'ID'
But if I add interfaces = (Node,) to the meta of Person the error goes away. However, I am also now forced to paginate through data which I know will also be only a small collection.
The text was updated successfully, but these errors were encountered:
SpinyCucumber
added a commit
to SpinyCucumber/graphene-mongo
that referenced
this issue
Jan 1, 2022
Suppose I have this document structure:
Then I define my MongoengineObjectTypes:
Then I build my schema:
This spits out an unfriendly error:
But if I add
interfaces = (Node,)
to the meta ofPerson
the error goes away. However, I am also now forced to paginate through data which I know will also be only a small collection.The text was updated successfully, but these errors were encountered: