Edit Page

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, and input

  • Native MongoDB data types like ObjectId and BsonDocument

  • 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

  1. Define your GraphQL schema

  2. Create a GraphQL app definition JSON document

  3. Map your types to MongoDB collections

  4. 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

Ready to Begin?

Check out our Quick Start Tutorial or dive into App Definition details!

Try It Yourself!

Why not put your knowledge into practice? Follow the GraphQL RESTHeart Tutorial!