Skip to content

Instantly share code, notes, and snippets.

@johncmckim
Last active August 30, 2016 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johncmckim/cd7c21551bec2f9c8ef16f08f80a21bc to your computer and use it in GitHub Desktop.
Save johncmckim/cd7c21551bec2f9c8ef16f08f80a21bc to your computer and use it in GitHub Desktop.
Garden Aid - React - Moisture container
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}") {
date, moisture
}
}`,
variables: {},
pollInterval: 1000 * 30, // 30 seconds
},
};
},
})(MoistureChart);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment