GraphQL Expected Iterable, but did not find one for field xxx.yyy

I ran into this problem as well. It appears that what you’re returning from your resolver doesn’t match the return type in your schema.

Specifically for the error message Expected Iterable, but did not find one for field library.user., your schema expects an array(Iterable) but you aren’t returning an array in your resolver

I had this in my schema.js:

login(email: String, password: String): [SuccessfulLogin]

I changed that to:

login(email: String, password: String): SuccessfulLogin

Notice the square brackets around “SuccessfulLogin”. It’s up to you whether you want to update the resolver return type or update the schema’s expectations

Leave a Comment