Skip to content

Using legacy schema with legacy serializer/adapter errors in shouldSerializeHasMany #10454

@BoussonKarel

Description

@BoussonKarel

I've gone ahead and migrated some some resources off of model and to schema, but the JSON serializer is throwing an error when trying to decide whether it should serialize a hasMany:

// @ts-expect-error store is dynamically injected
const schema = this.store.modelFor(snapshot.modelName);
// @ts-expect-error store is dynamically injected
const relationshipType = schema.determineRelationshipType(relationship, this.store);

determineRelationshipType exists on Model but not on my legacy resource schema.

This is probably overlooked because of the ts-expect-error above the line.

My legacy resource schema is made using withDefaults from @warp-drive/legacy/model/migration-support, so it's not a Model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions