Data access 

Data stored in your Gadget database is accessible in two ways:

  1. By making calls to your project's public API's: Your project's API gives you the ability to retrieve, sort, search, filter or paginate any record(s) stored in your Gadget database. You can make API calls in GraphQL, JS, or React. This approach is typically recommended for arbitrary queries (e.g. a query that includes filters selected by the user on your frontend).

  2. By building computed fields: Computed fields are a read-only field type that stores predefined queries that Gadget keeps performant and indexed. Like any other field type, you can access the computations of queries stored in computed fields by reading them via your API. This approach is typically recommended for predefined, aggregate queries that can be resource intensive to run at read time (e.g. display a sum of orders on an orders index page every time the user loads that page).

Was this page helpful?