Types is not iterable

A few suggestions:

  1. I highly recommend you use TypeScript for building your projects, it can be tremendously valuable in debugging these sorts of things. GraphQL and TypeScript go together really well!

  2. You have a typo in one of your directory names in your reproduction — grapqhl should be graphql. I don’t know if this was causing a problem sinc the enum.js was the same in both places, but I removed it.

  3. The schema was not defined in the index.js. I imported it by adding:

    const { schema } = require('./utils/schema');
    
  4. Your ./utils/schema is using ECMAScript modules (e.g., export const) but the rest of your project is all in CommonJS (e.g., expecting module.exports).

  5. Once I fixed all these things, I still received the error:

    Error: Unknown type "UserRoleEnum".
    
    Unknown type "User".
    

    … which seems to show that some pieces are still missing.

I recommend taking a bit more time to put together a reproduction and going through each of the errors I’ve noted above and carefully observing their error messages. In every case except the misspelling of GraphQL (something I personally do all the time by the way!), the console output or VS Code interface (which I also recommend!) showed me the source of the error.

It’s also worth noting that we have a great Apollo Odyssey tutorial available called Lift-off available. It does not use GraphQL Tools (a project which Apollo no longer maintains) but it does require familiarity and comfort with JavaScript.