List actions
A model with a list
action creates a page that renders a table view of all entries related to the given inputs, or if the action does not have required inputs, the tool will automatically fetch the relevant data.
An example of a Keel schema model with a list action, which will create a tool with status
and customer id
as optional input fields.
model Order {
actions {
list listOrders(status?, customer.id?)
}
}
Request
If this action has inputs, it generates an inputs panel with a form that runs the action. This form will also include the cursor pagination fields, which Keel provides for all list actions. These will soon be moved to be table pagination buttons and removed from the input form.
For any of the id input fields, if the model has a relevant list action, you will see a "lookup" action button within the input field to help you quickly find an entry. Learn more here
Response
All fields from the model will be rendered as rows inside a table, ordered in the same way as your Keel schema fields are listed. Any fields that are linked to other models will render a relationship field.
Clicking on a row will take you to the single entry get action page, with the id field pre-filled so that you can quickly view that entry and find other relevant mutation actions to run on that entry.
Pagination
Coming soon.
Extras
This tool will also show you a create
action button in the toolbar, if your Keel schema includes a create action on the same model.
In the toolbar, you can also find a dropdown menu with other list actions for the same model. Find out more here.