Ash FrameworkAF
Ash Framework7mo ago
14 replies
Cyprien

relationship data

Hello everyone!
I'm trying to migrate the backend of an old ember app from rails/json-api-resources to Ash. The resources produced by rails contain relationship data even when not added in includes. I can't reproduce this with Ash, and would like to know if it's possible.

{
    "data": {
        "attributes": {...},
        "id": "73",
        "links": {},
        "meta": {},
        "type": "parent",
        "relationships": {
            "children": {
                "links": {
                    "related": "https://.../api/parent/73/children"
                },
                // Here I have this in rails:
                data: [
                       {"type": "child", "id": "82886"},
                       {"type": "child", "id": "82887"},
                        ...
                ]
                "meta": {}
            }
        }
    },
}

From what I've seen in the docs, it seems the only way to have this data attribute filled in with the linkage data is to add the relationship in includes. But I can't see what I should do when I want the linkage data but not the relationship data itself (because it is already loaded)
Was this page helpful?