Elegantly composable. Made for ActiveRecord
This package provides utilities for working with ActiveRecord APIs with EmberData.
Installation
Install using your javascript package manager of choice. For instance with pnpm
pnpm add @ember-data/active-record
Getting Started
If this package is how you are first learning about EmberData, we recommend starting with learning about the Store and Requests
Request Builders
Request builders are functions that produce Fetch Options. They take a few contextual inputs about the request you want to make, abstracting away the gnarlier details.
For instance, to fetch a resource from your API
import { findRecord } from '@ember-data/active-record/request';
const options = findRecord('ember-developer', '1', { include: ['pets', 'friends'] });
Request builder output may be used with either requestManager.request
or store.request
.
URLs are stable. The same query will produce the same URL every time, even if the order of keys in
the query or values in an array changes.
URLs follow the most common ActiveRecord format (underscored pluralized resource types).
Available Builders