Class DelegatingSchemaService
public
Extends:
SchemaService
Defined in:
../model/src/migration-support.ts:365
A class which provides a schema service that delegates between a primary schema service and one that supports legacy model classes as its schema source.
When the primary schema service has a schema for the given resource, it will be used. Otherwise, the fallback schema service will be used.
This can be used when incrementally migrating from Models to SchemaRecords by enabling unmigrated Models to continue to provide their own schema information to the application.
import { DelegatingSchemaService } from '@ember-data/model/migration-support';
import { SchemaService } from '@warp-drive/schema-record';
class AppStore extends Store {
createSchemaService() {
const schema = new SchemaService();
return new DelegatingSchemaService(this, schema);
}
}
All calls to register resources, derivations, transformations, hash functions etc. will be delegated to the primary schema service.