GraphQL API for MongoDB
The restheart-graphql
plugin seamlessly integrates GraphQL with MongoDB, enabling you to build modern data-driven applications without writing resolvers or backend code. Simply define your schema and mappings, and RESTHeart handles the rest.
Key Features
Powerful Schema Support
-
Full GraphQL type system:
type
,query
,enum
,interface
,union
, andinput
-
Native MongoDB data types like
ObjectId
andBsonDocument
-
Automatic schema introspection for IDE and tool support
Flexible MongoDB Integration
-
Direct field-to-field mappings for simple cases
-
Query-based field resolution for relationships
-
Aggregation pipeline support for complex transformations
-
Automatic handling of nested document structures
Developer Experience
-
Zero-code implementation - just configure and go
-
GraphQL Playground integration for testing
-
Schema validation and error reporting
-
Support for popular GraphQL clients like Postman and Insomnia
Performance & Scalability
-
Built-in query batching and caching
-
N+1 query problem mitigation
-
Connection pooling and query optimization
Getting Started
-
Define your GraphQL schema
-
Create a GraphQL app definition JSON document
-
Map your types to MongoDB collections
-
Deploy to RESTHeart
Your GraphQL API is accessible via HTTP POST requests:
- Content types: application/json
or application/graphql
- Response format: application/graphql-response+json