summaryrefslogtreecommitdiffstats
path: root/frontend/components
diff options
context:
space:
mode:
authorPeggy Rayzis <peggyrayzis@gmail.com>2018-05-22 13:00:54 -0400
committerPeggy Rayzis <peggyrayzis@gmail.com>2018-05-23 17:26:15 -0400
commit444defc6e5709c46d935dbff8e90538156915457 (patch)
tree5363d1be371593ccec20fde98bde120d20ba58fe /frontend/components
parent8cdede8860f05a2648d17fcb412fb3c2ec3966c9 (diff)
Remove unnecessary Query component
Diffstat (limited to 'frontend/components')
-rw-r--r--frontend/components/AddToCart.js26
1 files changed, 11 insertions, 15 deletions
diff --git a/frontend/components/AddToCart.js b/frontend/components/AddToCart.js
index c79e644..7cb0856 100644
--- a/frontend/components/AddToCart.js
+++ b/frontend/components/AddToCart.js
@@ -1,5 +1,5 @@
import { Component } from 'react';
-import { Mutation, Query } from 'react-apollo';
+import { Mutation } from 'react-apollo';
import PropTypes from 'prop-types';
import {
ADD_TO_CART_MUTATION,
@@ -34,21 +34,17 @@ class AddToCart extends Component {
render() {
const { id } = this.props;
return (
- <Query query={CURRENT_USER_QUERY}>
- {() => (
- <Mutation
- mutation={ADD_TO_CART_MUTATION}
- variables={{ id }}
- update={this.update}
- >
- {(addToCart, { loading }) => (
- <button disabled={loading} onClick={addToCart}>
- 🛒 Add{loading && 'ing'} To Cart
- </button>
- )}
- </Mutation>
+ <Mutation
+ mutation={ADD_TO_CART_MUTATION}
+ variables={{ id }}
+ update={this.update}
+ >
+ {(addToCart, { loading }) => (
+ <button disabled={loading} onClick={addToCart}>
+ 🛒 Add{loading && 'ing'} To Cart
+ </button>
)}
- </Query>
+ </Mutation>
);
}
}