This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type MasterPanel { | |
id: ID | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TOP LEVEL IMPORTS | |
import gql from 'graphql-tag'; | |
export default gql` | |
query getcoffeecupreport($timestamp: Float, $shift: String, $count: Int, $skip: Int) { | |
getcoffeecupreport(timestamp: $timestamp, shift: $shift, count: $count, skip: $skip) { | |
total | |
machines { | |
id | |
name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ========================================== | |
// USERS | |
// ========================================== | |
const USERS = { | |
id: String, | |
firstName: String, | |
lastName: String, | |
email: String, | |
title: String, | |
employeeId: String, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | |
# yarn lockfile v1 | |
"@accounts/boost@^0.19.0": | |
version "0.19.0" | |
resolved "https://registry.yarnpkg.com/@accounts/boost/-/boost-0.19.0.tgz#c3ac2df56977d41748ef797cfe758fa338cb66e8" | |
dependencies: | |
"@accounts/database-manager" "^0.19.0" | |
"@accounts/graphql-api" "^0.19.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { typeCheck } from 'type-check'; | |
export default ({ name }) => { | |
// setup a variable called programName that we'll eventually return | |
let programName = name; | |
// if no program exists, return null | |
if (!name) { | |
console.log('You need to pass a name'); | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Users from './model'; | |
const getById = async id => { | |
try { | |
if (!id) return null; | |
// search for inventory item | |
let doc = await Users.findOne({ _id: id }); | |
return doc; // firebase doesnt include the id, so tack it on | |
} catch (err) { | |
console.log(err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Mongo from 'modules/mongodb'; | |
const EmailModel = new Mongo.Schema({ | |
address: String | |
}); | |
const schema = new Mongo.Schema({ | |
id: String, | |
emails: [EmailModel] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { gql } from 'apollo-server'; | |
import UserProfiles from 'collections/UserProfiles/model'; | |
import Users from 'collections/Users/helpers'; | |
export const UserProfileResolvers = { | |
UserProfile: { | |
id: root => { | |
// in some cases we'll already have masked _id for id, so check if id exists and return that if it does exist | |
if (root.id) return root.id; | |
// if id doesn't exist yet, we'll return _id as id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// // TOP LEVEL IMPORTS | |
import { merge } from 'lodash'; | |
import { gql } from 'apollo-server'; | |
// // User | |
import { QueryResolvers, QuerySchema } from './types/Query'; | |
import { MutationSchema, MutationResolvers } from './types/Mutation'; | |
import { UserProfileSchema, UserProfileResolvers } from './types/UserProfile'; | |
// using interefaces with each vendor's schema (caterer, venue, etc) will throw an error if one of the types is missing something form our Vendor interface... not exactly like classes/inheritance, but at least it will keep the sub-types in like with the Vendor type.... albeit not DRY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import mongoose from 'mongoose'; | |
import AccountsPassword from '@accounts/password'; | |
import MongoDBInterface from '@accounts/mongo'; | |
import AccountsServer from '@accounts/server'; | |
import { AccountsModule } from '@accounts/graphql-api'; | |
import { ApolloServer } from 'apollo-server'; | |
import { merge } from 'lodash'; | |
import { typeDefs, CustomResolvers } from './src/graphql-api/index'; | |
import { db } from './src/modules/mongodb.js'; | |
import emailTransporter from './src/modules/email.js'; |