3.0.1 • Published 5 years ago

@stellar-apps/apollo v3.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

@stellar-apps/apollo

This package contains react-apollo utilities and components

Installation

yarn add @stellar-apps/apollo

Usage

import {MutationForm, MutationButton} from '@stellar-apps/apollo'

MutationForm

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.

Props

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
  • 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} from Formik as {variables}

Render function


MutationButton

A wrapper for SpinnerButton above and react-apollo/Mutation

Props

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
  • 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} from Formik as {variables}
3.0.1

5 years ago

3.0.0

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago