byTracking Plugin
Adds createdBy and updatedBy fields to a list. These fields are read-only but they will be updated automatically when items are created or updated.
Usage
const { byTracking } = require('@keystonejs/list-plugins');
keystone.createList('ListWithPlugin', {
  fields: {
    // ...
  },
  plugins: [
    byTracking({
      /* ...config */
    }),
  ],
});
Config
| Option | Type | Default | Description | 
|---|---|---|---|
| createdByField | String | createdBy | Name of the createdByfield. | 
| updatedByField | String | updatedBy | Name of the createdByfield. | 
| ref | String | User | A reference to the list authenticated items (users). | 
| access | Object | See: access | Change default access controls. | 
access
By default access control on at tracking fields is read only:
{
  read: true,
  create: false,
  update: false
}
Disabling created or updated
You can import either createdBy or updatedBy to apply a single tracking field:
const { createdBy, updatedBy } = require('@keystonejs/list-plugins');
Note: The API is the same.