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

Function withRestoredDeprecatedModelRequestBehaviors()

ts
function withRestoredDeprecatedModelRequestBehaviors(schema): LegacyResourceSchema;

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

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.