Skip to main content
Enables retrieval of tailored data This is useful in the following scenarios
  • You need to retrieve data from a different source than the application database
  • You want to customize the data returned by the query
  • You have complex queries that Codenull cannot process using the normal entity endpoints.

How to create a Custom Query Endpoint

  1. Create your hook to customize your data
You need to create a Custom Query Endpoint hook, for instance
Here you can also import your database model or call external APIs, the important thing here is that you must return the data using the same structure { items, total } If you want you can use your default model defined in the next step via options.model which in this example is Persona, but this is optional.
  1. Define your Query
Define the data source where you’ll use the data retrieved by the hook. Use the Hook’s ID to attach it to

How to use filters and params in a Custom Query Endpoint

Let’s define a hook that needs to fetch data from an external source
Let’s configure the data source for the component (Datagrid for instance)