Skip to content

Instantly share code, notes, and snippets.

@kamilkisiela
Last active October 30, 2018 09:34
Show Gist options
  • Save kamilkisiela/21dd15eea058b672305f94eace382d26 to your computer and use it in GitHub Desktop.
Save kamilkisiela/21dd15eea058b672305f94eace382d26 to your computer and use it in GitHub Desktop.
import {Mutation} from '@loona/react';
const ADD_BOOK = gql`
mutation AddNewBook($title: String!) {
addBook(title: $title) @client {
id
title
}
}
`;
const NewBook = () => (
<Mutation mutation={ADD_BOOK}>
{(addBook) => (
<BookForm onBook={(title) => addBook({variables: {title}}) }>
)}
</Mutation>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment