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
Exception: Received incompatible instance "<generator object PeeweeNodeField.node_resolver at 0x1082b6930>".
It seems like this promise commit cause the problem.(it works on promise==2.2.0 but doesn't work in 2.2.1)
The trackback shows the function is_valid_peewee_model raise this exception, we can see the correct type of type(root) should return some models like <class 'tests.common.models.Author'>,but now it will only return <class 'generator'>
# graphene-peewee-async/graphene_peewee_async/types.py
@classmethod
def is_type_of(cls, root, info, **args):
...
if not is_valid_peewee_model(type(root)):
raise Exception((
'Received incompatible instance "{}".'
).format(root))
...
Can it be solved only by fixed version with promise<=2.2.0?
The text was updated successfully, but these errors were encountered:
Thanks for reporting and so deep investigation into this issue!
What I've found is that there's a difference in how asyncio's and inpect's iscoroutine decides on "old-style" coroutines, created using decorators. inspect's version doesn't consider generators as coroutines while asyncio's version (which was used in promise==2.2.0) does. We can simply upgrade to async/await here and here to make it work, but I'll think a bit more about backward compatibility for Python 3.4 and reply back in few days.
Yes, seems like a promise==2.2.1 compatibility issue with generator-based coroutines (as well as with Python 3.4). I've opened an issue for it: syrusakbary/promise#69. So yes, it can be solved by downgrading promise package or by monkey-patching it if you really need >=2.2.1:
I try to use the middleware in /graphene-peewee-async/test/common/api_test like
but it raise an exception
It seems like this promise commit cause the problem.(it works on promise==2.2.0 but doesn't work in 2.2.1)
The trackback shows the function
is_valid_peewee_model
raise this exception, we can see the correct type oftype(root)
should return some models like<class 'tests.common.models.Author'>
,but now it will only return<class 'generator'>
Can it be solved only by fixed version with promise<=2.2.0?
The text was updated successfully, but these errors were encountered: