ApolloMatic is an open-source developer tool that automates Mongoose to GraphQL integration.
Automatic Schema Generation: Apollomatic automatically generates GraphQL schemas based on your existing Mongo schemas, including types for queries, mutations, and the Mongo objects.
Efficient Resolvers: The package creates resolvers that correspond to the types within the GraphQL schema, saving you the effort of writing them from scratch. These resolvers are functionally integrated with your database, linked to your Mongo models.
Time-Saving Solution: Whether you are new to GraphQL or an experienced developer, Apollomatic can significantly reduce the time and effort required to set up your GraphQL API.
Before you can use Apollomatic, ensure you have Node.js and NPM installed on your system. To install Apollomatic, follow these steps:
Run the following command in your project's root directory:
npm install -g apollomatic
Once installed, you can use Apollomatic by running the following command in your terminal:
npx apollomatic
To configure Apollomatic for your project, create an apollo-config.js file
.
This file contains the necessary information for Apollomatic to work. Here's how to set up your apollo-config.js
:
- Navigate to your project's root directory.
- Locate the apollo-config.js file provided in the Apollomatic package. You can find it in the "templates" directory.
- Copy the config file and paste it into your project's root directory.
- Modify the copied apollo-config.js file to match your project's specific configuration needs. You can refer to our documentation for guidance on configuring Apollo.
Save your changes. Now, your project is configured with Apollo using the apollo-config.js file you customized.
Apollomatic will take your Mongoose schemas and generate code for you to get started in Apollo Server. If the installation is successful, two new files will appear in your project directory: an index.js file under the "resolvers" folder and a schema.js file under the "src" folder .
- Custom scalar Types
- Object Types
- Input Types
- Query Types
- Mutation Types
- Query Resolvers
- Mutations Resolvers
This will allow for full CRUD functionality.
You can test your generated resolvers in the following ways:
If you've set up an endpoint for your project, you can test your resolvers within Apollo Studio's Explorer interface. Note that data must be present in the connected database for the queries to return results.
Resolvers can also be tested using Postman. Ensure that the GraphQL option is selected for the 'Body' section, and the query and variables components should be configured.
If you need assistance or have questions about Apollomatic, you can reach out to us at [email protected]. Additionally, found a bug or have an idea? Please open an issue or start a discussion. We value your feedback and contributions to make Apollomatic even more powerful and user-friendly.
Getting Help
Features | Next Steps |
---|---|
Frontend | - Building out the playground/explorer page |
 | - Accessbility + screen responsiveness |
 | - Continuing to maintain docs as project evolves |
Subscriptions | - In addition to queries and mutations, GraphQL supports a third operation type: subscriptions . |
 | - Like queries, subscriptions enable you to fetch data. Unlike queries, subscriptions are long-lasting operations that can change their result over time. |
 | - They can maintain an active connection to your GraphQL server (most commonly via WebSocket), enabling the server to push updates to the subscription's result. |
Codebase | - In addition to queries and mutations, GraphQL supports a third operation type: subscriptions . |
 | - Converting code to TypeScript |
 | - Implementing testing (unit + integration) |
Kahalia Stanberry |
John Bilunas |
Juilia Breeden |
Davis Kim |