({ id })
| 11 | `; |
| 12 | |
| 13 | export default function AddToCart({ id }) { |
| 14 | const [addToCart, { loading }] = useMutation(ADD_TO_CART_MUTATION, { |
| 15 | variables: { id }, |
| 16 | refetchQueries: [{ query: CURRENT_USER_QUERY }], |
| 17 | }); |
| 18 | return ( |
| 19 | <button disabled={loading} type="button" onClick={addToCart}> |
| 20 | Add{loading && 'ing'} To Cart 🛒 |
| 21 | </button> |
| 22 | ); |
| 23 | } |
nothing calls this directly
no outgoing calls
no test coverage detected