Skip to content

Instantly share code, notes, and snippets.

@kamilkisiela
Last active October 15, 2018 11:41
Show Gist options
  • Save kamilkisiela/6bbc389bddae4107d40bc046a51da693 to your computer and use it in GitHub Desktop.
Save kamilkisiela/6bbc389bddae4107d40bc046a51da693 to your computer and use it in GitHub Desktop.
import React from 'react';
import { Mutation } from '@loona/react';
export default props => (
<Mutation mutation={ADD_BOOK}>
{addBook => (
<button onClick={() => addBook({
variables: {
title: props.title
},
// update() {
// we keep it all inside of the state class
// otherwise it would be hard to persist those store updates
// }
})}> Submit </button>
)}
</Mutation>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment