Skip to content

oslabs-beta/ApolloMatic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is ApolloMatic?

ApolloMatic is an open-source developer tool that automates Mongoose to GraphQL integration.

Tech Stack

Quick Links

💻 Browse our website     Check out our Medium Article     Catch us on LinkedIn     Visit our npm library

Features

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.

Tech Stack Needed in Your Project:

Installation

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

Configuration

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 in Action

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 .

The schema.js file will be populated with definitions for the following:

  • Custom scalar Types
  • Object Types
  • Input Types
  • Query Types
  • Mutation Types

The index.js file will be populated with:

  • Query Resolvers
  • Mutations Resolvers

This will allow for full CRUD functionality.

Testing

You can test your generated resolvers in the following ways:

Apollo Studio:

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.

Postman:

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.

Need Help?

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

Usage Notes

Roadmap

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)

Authors


Kahalia Stanberry

John Bilunas

Juilia Breeden

Davis Kim

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •