Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eventonehq/gql-module-loader
💻 Easily modularize your GraphQL schema
https://github.com/eventonehq/gql-module-loader
apollo-server graphql graphql-server modular nodejs
Last synced: 30 days ago
JSON representation
💻 Easily modularize your GraphQL schema
- Host: GitHub
- URL: https://github.com/eventonehq/gql-module-loader
- Owner: eventOneHQ
- License: mit
- Created: 2019-06-19T17:54:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-07T06:08:42.000Z (over 2 years ago)
- Last Synced: 2024-10-13T03:12:04.227Z (about 1 month ago)
- Topics: apollo-server, graphql, graphql-server, modular, nodejs
- Language: JavaScript
- Homepage: https://oss.eventone.page/gql-module-loader
- Size: 1.29 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
GraphQL Module Loader
![npm](https://img.shields.io/npm/v/gql-module-loader.svg)
[![GitHub Issues](https://img.shields.io/github/issues/eventOneHQ/gql-module-loader.svg)](https://github.com/eventOneHQ/gql-module-loader/issues)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/eventOneHQ/gql-module-loader.svg)](https://github.com/eventOneHQ/gql-module-loader/pulls)
[![GitHub license](https://img.shields.io/github/license/eventOneHQ/gql-module-loader.svg)](https://github.com/eventOneHQ/gql-module-loader/blob/master/LICENSE)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)---
Easily modularize your GraphQL schemas
## 📝 Table of Contents
- [Getting Started](#getting_started)
- [Usage](#usage)
- [Contributing](CONTRIBUTING.md)
- [Authors](#authors)
- [Acknowledgments](#acknowledgement)Getting started with `gql-module-loader` is pretty easy and straight forward.
Install the `gql-module-loader` package into your project:
```
npm i gql-module-loader
```Create a module:
```javascript
// modules/auth.js
const { gql } = require('apollo-server-express')const Auth = {
schema: {
typeDefs: gql``,
resolvers: {}
}
}module.exports = Auth
```Then load the modules all together and use the combined schema:
```javascript
// server.js
const { moduleLoader } = require('gql-module-loader')
const { makeExecutableSchema } = require('graphql-tools')
const { ApolloServer } = require('apollo-server-express')const Root = require('./modules/root')
const Auth = require('./modules/auth')const { schema } = moduleLoader([Root, Auth])
const server = new ApolloServer({
schema: makeExecutableSchema(schema)
})
```See the full docs [here](https://oss.eventone.page/gql-module-loader).
- [@nprail](https://github.com/nprail) - Maintainer
See also the list of [contributors](https://github.com/eventOneHQ/gql-module-loader/contributors) who participated in this project.
- Hat tip to anyone whose code was used