@8base-react/crud

8base CRUD is a wrapper under the react-apollo component to simplify working with the crud operations.

Usage no npm install needed!

<script type="module">
  import 8baseReactCrud from 'https://cdn.skypack.dev/@8base-react/crud';
</script>

README

8base CRUD

8base CRUD is a wrapper under the react-apollo component to simplify working with the crud operations.

API

Table of Contents

RecordsList

Extends Component

Component for fetching the table content

Properties

  • tableName string Name of the table
  • tableId string Id of the table

RecordCreate

Extends Component

Component for creating the record of the table

Properties

  • tableName string Name of the table
  • tableId string Id of the table

RecordCreateMany

Extends Component

Component for creating many records of the table

Properties

  • tableName string Name of the table
  • tableId string Id of the table

ChildrenPropObject

Results of the record update queries and mutation

Properties

RecordUpdate

Extends Component

Component for updating the record of the table

Properties

  • tableName string Name of the table
  • tableId string Id of the table
  • recordId string Id of the record

RecordDelete

Extends Component

Component for deleting the record of the table

Properties

  • tableName string Name of the table
  • tableId string Id of the table
  • recordId string Id of the record

Usage

  <RecordsList
    applicationName={ applicationName }
    tableName="someTableName"
    variables={ options.variables }
  >
    { ({ data, loading }) => (<div>{data}</div>) }
  </RecordsList>     
   <RecordUpdate
    tableId="table-id"
    recordId="42"
    onCompleted={ () => {
      ...
    } }
  >
    { (onSubmit, { tableMetaResult, recordDataResult, fetchingLoading }) => (
      <FormComponent initialValues={ recordDataResult.data } onSubmit={ onSubmit } />
    ) }
  </RecordUpdate>