A helper library for building GraphQL APIs with Sequelize models, providing automatic query resolution and field generation.
graphql-sequelize is a helper library that bridges GraphQL and Sequelize ORM, enabling developers to automatically resolve GraphQL queries against MySQL or PostgreSQL databases. It provides tools to generate GraphQL fields from Sequelize models and handle query arguments, reducing manual boilerplate code.
Backend developers building GraphQL APIs with Node.js who use Sequelize as their ORM for relational databases like MySQL or PostgreSQL.
Developers choose graphql-sequelize because it automates the mapping between GraphQL and Sequelize, supports Relay connections, and offers hooks for custom query logic, speeding up API development while maintaining flexibility.
GraphQL & Relay for MySQL & Postgres via Sequelize
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Converts GraphQL arguments like 'limit' and 'order' directly to Sequelize clauses, reducing resolver boilerplate as demonstrated in the resolver examples with automatic where, limit, and order handling.
Uses attributeFields to automatically create GraphQL fields from Sequelize model attributes, with customization options like mapping, exclusions, and type overrides as shown in the field helpers section.
Includes native support for Relay connections and pagination, simplifying implementation for GraphQL APIs that follow Relay specifications, as referenced in the relay documentation.
Offers before and after hooks to manipulate queries and results, allowing developers to inject custom logic without overriding entire resolvers, as detailed in the resolver options.
To prevent N+1 queries, the README explicitly states it should be used with dataloader-sequelize, adding an extra layer of setup and configuration complexity.
Inherits Sequelize's limitations, such as being optimized only for MySQL and PostgreSQL, and may not handle edge cases or advanced database features without custom workarounds.
For non-standard type mappings or advanced field generation, developers must use the mapType function or custom hooks, which can be cumbersome and error-prone, as seen in the typeMapper examples.