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
'use strict'; | |
const BbPromise = require('bluebird'); | |
const stampit = require('stampit'); | |
const moment = require('moment'); | |
const Logger = require('../logger'); | |
const MoistureService = stampit(). |
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
const graphql = require('graphql'); | |
const tablesFactory = require('./dynamodb/tables'); | |
const MoistureService = require('./services/moisture'); | |
const tables = tablesFactory(); | |
const moistureService = MoistureService({ moistureTable: tables.Moisture }); | |
const MoistureType = new graphql.GraphQLObjectType({ | |
name: 'MoistureType', |
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
const vogels = require('vogels-promisified'); | |
const Joi = require('joi'); | |
module.exports = () => { | |
const moistureTableName = process.env.moistureTableName; | |
if(!moistureTableName) { | |
throw new Error("Missing moisture table name"); | |
} |
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
service: garden-aid-web-bff | |
provider: | |
name: aws | |
runtime: nodejs4.3 | |
iamRoleStatements: | |
- Effect: Allow | |
Action: | |
- dynamodb:DescribeTable | |
- dynamodb:Query | |
- dynamodb:Scan |
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 gql from 'graphql-tag'; | |
import { connect } from 'react-apollo'; | |
import MoistureChart from '../../pres/Moisture/Chart'; | |
export default connect({ | |
mapQueriesToProps({ ownProps, state }) { // eslint-disable-line no-unused-vars | |
return { | |
moisture: { | |
query: gql`{ | |
moisture(hours: ${ownProps.hours}, clientId: "${ownProps.clientId}") { |
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 { createStore, applyMiddleware, compose, combineReducers } from 'redux'; | |
import { routerMiddleware, routerReducer } from 'react-router-redux'; | |
import reduxThunk from 'redux-thunk'; | |
import createLogger from 'redux-logger'; | |
import reducerFactory from '../reducers'; | |
export default function createAppStore(browserHistory, client, initialState = {}) { | |
const middlewares = [ |
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 { GRAPHQL_URL } from 'constants'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Router, browserHistory } from 'react-router'; | |
import { syncHistoryWithStore } from 'react-router-redux'; | |
import withScroll from 'scroll-behavior'; | |
import ApolloClient, { createNetworkInterface } from 'apollo-client'; |
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
#!/bin/bash | |
if [[ $TRAVIS_TEST_RESULT == 1 ]]; then | |
echo 'Skipping deploy due to broken build'; | |
exit 1; | |
fi | |
echo 'Starting deploy' | |
if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then |
NewerOlder