Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterable may not support len #14

Open
genericmoniker opened this issue Feb 21, 2023 · 0 comments
Open

Iterable may not support len #14

genericmoniker opened this issue Feb 21, 2023 · 0 comments

Comments

@genericmoniker
Copy link

Thanks for the library! I'm trying to update an application to a current set of GraphQL libraries and this one could be helpful in that effort.

I ran into a problem trying to use it with a resolver function that returns an iterable value, but the value doesn't have __len__. In my case, it is a SQLAlchemy Query object, though a simple generator ought to behave similarly.

The trouble comes at this line:

results: List[Any] = [None] * len(result)

Which raises an exception for the type not having len(). The check earlier in the function for is_iterable(result) passes fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant