This file contains hidden or 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 'meteor/mongo' | |
| const Todos = new Mongo.Collection('todos') | |
| const TodosSchema = new SimpleSchema({ | |
| text: { | |
| type: String | |
| }, | |
| completed: { | |
| type: Boolean | |
| }, | |
| owner: { |
This file contains hidden or 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 { graphqlExpress, graphiqlExpress } from 'graphql-server-express'; | |
| import bodyParser from 'body-parser'; | |
| import express from 'express'; | |
| import { Meteor } from 'meteor/meteor'; | |
| import { WebApp } from 'meteor/webapp'; | |
| import { check } from 'meteor/check'; | |
| import { Accounts } from 'meteor/accounts-base'; | |
| import { _ } from 'meteor/underscore'; |
This file contains hidden or 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 {Meteor} from 'meteor/meteor' | |
| export default function (root, args, context) { | |
| // if the user is not logged in throw an error | |
| if (!context.userId) { | |
| throw new Error('Unknown User (not logged in)') | |
| } | |
| // find the user using the userId from the context | |
| return Meteor.users.findOne(context.userId) | |
| } |
This file contains hidden or 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 me from './me' | |
| export default { | |
| me | |
| } |
This file contains hidden or 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 {Resolvers as Auth} from 'meteor/nicolaslopezj:apollo-accounts' | |
| export default { | |
| ...Auth() | |
| } |
This file contains hidden or 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 Query from './Query' | |
| import Mutation from './Mutations' | |
| export default { | |
| Query, | |
| Mutation | |
| } |
This file contains hidden or 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 User from './User.graphql' | |
| import Query from './Query.graphql' | |
| import {SchemaTypes as Auth} from 'meteor/nicolaslopezj:apollo-accounts' | |
| import Mutation from './Mutation' | |
| export default [ | |
| Auth({ | |
| CreateUserProfileInput: ` | |
| name: String | |
| ` | |
| }), |
This file contains hidden or 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 { createApolloServer } from 'meteor/orionsoft:apollo' | |
| import { makeExecutableSchema } from 'graphql-tools' | |
| import typeDefs from './schema' | |
| import resolvers from './resolvers' | |
| import cors from 'cors' | |
| const schema = makeExecutableSchema({ | |
| typeDefs, | |
| resolvers | |
| }) |
This file contains hidden or 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
| function modeminit (mo) { | |
| l(mo) | |
| l('mo') | |
| var m = new modem(mo.config) |
This file contains hidden or 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
| // I have app.js where I have this code somewhere | |
| //an array of modems I read from udev, in this case 2 modems | |
| mod = [ { DEVNAME: '/dev/ttyUSB3', | |
| ID_MODEL: 'E398 LTE/UMTS/GSM Modem/Networkcard' }, | |
| { DEVNAME: '/dev/ttyUSB0', | |
| ID_MODEL: 'E173s 3G broadband stick (modem on)' } ] | |
| //then I do | |
| mod.forEach(function (dev) { |