This package contains react-apollo
utilities and components
yarn add @stellar-apps/apollo
import {MutationForm, MutationButton} from '@stellar-apps/apollo'
A render props component for easily implementing a react-apollo
-based Mutation form using Formik. No
fetch
polyfill is provided because the assumption is you're already implementing such a thing with
your Apollo implementation.
In addition to the props below, it inherits props from Formik and react-apollo Mutation
confirm {func}
- If defined, the mutation will only run if this function returns
true
- Receives two arguments
(formikValues, formikBag)
seen here
- If defined, the mutation will only run if this function returns
prepareUpdate {func}
- default
({variables}) => ({variables})
- Should return an object to send to the
react-apollo
mutate()
function. See here for details on additional options. - By default this returns the
{values}
fromFormik
as{variables}
- default
children(<formik>, <mutationResult>)
formik
mutationResult
- See Mutation result here
A wrapper for SpinnerButton
above and react-apollo/Mutation
In addition to the props below, this component also receives props for SpinnerButton
above and
react-apollo Mutation
confirm {func}
- If defined, the mutation will only run if this function returns
true
- Receives two arguments
(formikValues, formikBag)
seen here
- If defined, the mutation will only run if this function returns
prepareUpdate {func}
- default
({variables}) => ({variables})
- Should return an object to send to the
react-apollo
mutate()
function. See here for details on additional options. - By default this returns the
{values}
fromFormik
as{variables}
- default