UNPKG

pubsweet-component-bookbuilder

Version:

43 lines (38 loc) 859 B
import React from 'react' import { Mutation } from '@apollo/react-components' import gql from 'graphql-tag' const CREATE_BOOK_COMPONENT = gql` mutation CreateBookComponent($input: BookComponentInput!) { addBookComponent(input: $input) { id title divisionId componentTypeOrder pagination { left right } archived workflowStages { label type value } content componentType trackChangesEnabled uploading } } ` const createBookComponentMutation = props => { const { render } = props return ( <Mutation mutation={CREATE_BOOK_COMPONENT}> {(addBookComponent, addBookComponentResult) => render({ addBookComponent, addBookComponentResult }) } </Mutation> ) } export default createBookComponentMutation