1.0.4 • Published 3 years ago

gql-module-loader v1.0.4

Weekly downloads
36
License
MIT
Repository
github
Last release
3 years ago

npm GitHub Issues GitHub Pull Requests GitHub license semantic-release


📝 Table of Contents

🏁 Getting Started

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:

// 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:

// 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)
})

🎈 Usage

See the full docs here.

✍️ Authors

See also the list of contributors who participated in this project.

🎉 Acknowledgements

  • Hat tip to anyone whose code was used
1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago