mickhansen / graphql-sequelize

GraphQL & Relay for MySQL & Postgres via Sequelize
MIT License
1.9k stars 172 forks source link

Use more readable SDL and declare resolvers apart in the documentation #565

Closed hendrul closed 4 years ago

hendrul commented 6 years ago

The documentation example could be far more readable if you define the schema in the graphql Schema definition language and create the resolvers object in other step.

intellix commented 6 years ago

Came here to create a similar issue. It seems consistently recommended throughout the GQL world to now define types via SDL and Resolvers separately. I think I saw @mickhansen echo something that he doesn't recommend the attributeFields() helper anymore because of it.

Guess someone just to replace the examples in the README with a PR that shows it like this

mickhansen commented 6 years ago

The primary reason i don't recommend attributeFields is that it makes schema generation kind of magic, which i dislike. Using SDL is probably the most anti magic you can get so that's definitely a good idea, although i have personally not yet made the transistion.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.