resolve_relations for deep field

Hi there,

is there any way to use the resolve_relations parameter for following relation (UNRESOLVED_UID):

{
  "story": {
    "name": "",
    "content": {
      "_uid": "---",
      "body": [],
      "field_sections": [
        {
          "_uid": "---",
          "title": "---",
          "component": "field_section",
          "fields": [
            {
              "_uid": "---",
              "component": "field_item",
              "field": "-UNRESOLVED_UID-"
            },
            {
              "_uid": "---",
              "component": "field_item",
              "field": "-UNRESOLVED_UID-"
            }
          ]
        },
        {
          "_uid": "---",
          "title": "---",
          "component": "field_section",
          "fields": [
            {
              "_uid": "---",
              "component": "field_item",
              "field": "-UNRESOLVED_UID-"
            },
            {
              "_uid": "---",
              "component": "field_item",
              "field": "-UNRESOLVED_UID-"
            }
          ]
        }
      ]
    }
  }
}

something like field_sections.fields.field maybe?

Thank you!

Hello @harry,

you need to pass the component name and the field like in this example: resolve_relations=field_item.field

You can also check the examples from our documentation: Storyblok API Documentation

Best regards
Hannes

Hello Hannes,

this did not work for me. I used it the exact way you proposed.
Do you know an alternative or why this wouldn’t work?

This is the structure im using in my projekt. Is it maybe because this is inside an array?

Regards
Harry

I just tested this again and this works as you described with v1 but not with v2

Hello @harry,

the behavior of the V2 API is different. Now you’re getting an array with the name rels in the payload. The JS client injects the resolved relations where they’re referenced in the content.

Best regards
Hannes