Skip to content
module@warp-drive/legacy/model/migration-support @legacy

Function withRestoredDeprecatedModelRequestBehaviors() ​

ts
function withRestoredDeprecatedModelRequestBehaviors(schema: WithPartial<LegacyResourceSchema, "identity" | "legacy">): LegacyResourceSchema;

Defined in: warp-drive-packages/legacy/src/model/migration-support.ts:403

Adds the necessasary fields to the schema for supporting the deprecated request methods on LegacyMode schemas.

Use this instead of withDefaults to add the fields and behaviors necessary to support Model-Like capabilities.

ts
import { withRestoredDeprecatedModelRequestBehaviors } from '@warp-drive/legacy/model/migration-support';

export const UserSchema = withRestoredDeprecatedModelRequestBehaviors({
  type: 'user',
  fields: [
    { name: 'firstName', kind: 'attribute' },
    { name: 'lastName', kind: 'attribute' },
  ]
});

Parameters ​

schema ​

WithPartial<LegacyResourceSchema, "identity" | "legacy">

Returns ​

LegacyResourceSchema

Released under the MIT License.