Skip to content
@legacy

Documentation / @warp-drive/legacy / model/migration-support / withRestoredDeprecatedModelRequestBehaviors

Function: withRestoredDeprecatedModelRequestBehaviors()

ts
function withRestoredDeprecatedModelRequestBehaviors(schema): LegacyResourceSchema;

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

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.