Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

apollo-module-authentication

2.0.0 • Public • Published

Introduction

Connector for mongodb for apollo. It also includes the base model for all context models.

This module is built in ES6 with no transpilation for easier debugging. You have to use Node 6+ to use it.

import { MongoConnector } from 'apollo-connector-mongodb');
 
const mongoURL = 'mongodb://localshot:27017/test';
 
const conn = new MongoConnector(mongoURL, () => {
  
  //init express and apollo
  const context = initContext(conn);
  const config = {
    schema,
    pretty : true,
    context
  };
 
  // launches a new express instance
  startExpress(config);
});

Model

class User extends BaseModel {
  method() {
    this.collection.find() ... // mogodb collection
  }
}

Install

npm i apollo-module-authentication

DownloadsWeekly Downloads

26

Version

2.0.0

License

MIT

Unpacked Size

140 kB

Total Files

30

Last publish

Collaborators

  • avatar