Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including apollo-module-authentication with all npm packages installed. Try it out:

var apolloModuleAuthentication = require("apollo-module-authentication")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

apollo-module-authentication v2.0.0

Apollo password authentication

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
  }
}
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free