@8base/crud

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

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@8base/crud
26190.37.23 years ago5 years agoMinified + gzip package size for @8base/crud in KB

Readme

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

API

Table of Contents

-   [Properties](#properties)
-   [Properties](#properties-1)
-   [Properties](#properties-2)
-   [Properties](#properties-3)
-   [Properties](#properties-4)
-   [Properties](#properties-5)

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>