I have several models that reference an event model.
Consider this payload for instance:
project:
event:
{
id: 3,
record: {
type: project,
id: 1
}
}
This specifies that the event belongs to project with id 1, and was working fine with ember data models.
Now in warpdrive I am using these schemas:
Project:
export const ProjectSchema = withDefaults({
type: 'project',
fields: [
{ kind: 'hasMany', name: 'events', type: 'event', options: { async: false, inverse: 'record', as: 'abstract-record' } }
]
})
Event:
export const EventSchema = withDefaults({
type: 'event',
fields: [
{ kind: 'belongsTo', name: 'record', type: 'abstract-record', options: { async: false, inverse: 'events', polymorphic: true } }
]
})
So, event.record should link the project.
And project.events should have the array of events
However, I get this error from warpdrive when querying events via store.request(...): Error: Expected type abstract-record to be a valid ResourceType and I have no idea what I might be missing.
Versions: all @warp-drive/* at ^5.8.1, using useLegacyStore from @warp-drive/legacy.
I have several models that reference an event model.
Consider this payload for instance:
project:
event:
This specifies that the event belongs to project with id 1, and was working fine with ember data models.
Now in warpdrive I am using these schemas:
Project:
Event:
So,
event.recordshould link the project.And
project.eventsshould have the array of eventsHowever, I get this error from warpdrive when querying events via store.request(...):
Error: Expected type abstract-record to be a valid ResourceTypeand I have no idea what I might be missing.Versions: all @warp-drive/* at ^5.8.1, using useLegacyStore from @warp-drive/legacy.