Skip to content

Getting a field from ref type as titleFieldId #3705

@halchester

Description

@halchester

Hello,

Description

Say I have a model that looks like this

const product = new CmsModelPlugin({
    ...required props,
    fields : [
   ... other fields
    {
    id: 'category'
    type : 'ref',
    settings:{
    models : [{modelId : 'category'}]
}
}
],
    titleFieldId : 'category'
})

and category looks like:

const category = new CmsModelPlugin({
    ...required props,
    fields : [
    {
    id: 'name',
    fieldId : 'name'
    ...props
    type : 'text',
}
],
    titleFieldId : 'name'
})

Intended outcome

When I go to admin app and then go the products, I want to see the category name as the titleFieldId.

Current outcome

It is saying that string cannot represent type of that object.

Notes

I am quite new to the webiny headless CMS, so how can I get around this issue? I figured it has something to do with Graphql but can't seem to find documentations on that.

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