Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added .DS_Store
Binary file not shown.
87 changes: 87 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

# Created by https://www.gitignore.io/api/node
# Edit at https://www.gitignore.io/?templates=node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# End of https://www.gitignore.io/api/node
12 changes: 7 additions & 5 deletions graphql/Schema/Schema.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import {
const { modelNames } = require('mongoose')

const {
GraphQLObjectType,
GraphQLNonNull,
GraphQLSchema,
GraphQLString,
GraphQLList,
GraphQLInt,
GraphQLBoolean
} from 'graphql/type';
} = require('graphql/type')

import ToDoMongo from '../../mongoose/todo'
const ToDoMongo = require('../../mongoose/todo')

/**
* generate projection object for mongoose
* @param {Object} fieldASTs
* @return {Project}
*/
export function getProjection (fieldASTs) {
module.exports.getProjection = function getProjection (fieldASTs) {
return fieldASTs.fieldNodes[0].selectionSet.selections.reduce((projections, selection) => {
projections[selection.name.value] = true;
return projections;
Expand Down Expand Up @@ -69,5 +71,5 @@ var schema = new GraphQLSchema({

});

export default schema;
module.exports.schema = schema

13 changes: 6 additions & 7 deletions mongoose/todo.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import mongoose from 'mongoose';

var Schema = mongoose.Schema;
const mongoose = require('mongoose')
const Schema = mongoose.Schema;

// create a schema
var toDoSchema = new Schema({
const toDoSchema = new Schema({
itemId: Number,
item: String,
completed: Boolean
}, {collection:"TodoList"});
}, { collection: "TodoList" });

// the schema is useless so far
// we need to create a model using it
var ToDo = mongoose.model('ToDo', toDoSchema);
const ToDo = mongoose.model('ToDo', toDoSchema);

export default ToDo
module.exports = ToDo

// Select an item from TodoList collection
// ToDo.find({item:"Gethyl"},(err,res)=>{
Expand Down
1 change: 0 additions & 1 deletion node_modules/.bin/babel

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/babel-doctor

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/babel-external-helpers

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/babel-node

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/babylon

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/jsesc

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/json5

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/latest-version

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/loose-envify

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/mime

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/mkdirp

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/nodemon

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/nopt

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/rc

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/regjsparser

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/repeating

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/semver

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/strip-json-comments

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/touch

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/user-home

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/abbrev/LICENSE

This file was deleted.

23 changes: 0 additions & 23 deletions node_modules/abbrev/README.md

This file was deleted.

62 changes: 0 additions & 62 deletions node_modules/abbrev/abbrev.js

This file was deleted.

Loading