apollo-module-authentication
TypeScript icon, indicating that this package has built-in type declarations

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

Package Sidebar

Install

npm i apollo-module-authentication

Weekly Downloads

27

Version

2.0.0

License

MIT

Unpacked Size

140 kB

Total Files

30

Last publish

Collaborators

  • tomitrescak