I am trying to traverse nested relationships and when Query with resourceCollection, the URL being generated is not the one as defined in the relationship:
func testNested() {
spine.findAll(University.self).onSuccess { collection, meta, jsonapi in
for university in collection.resources as! [University] {
// This attempts to load GET /organizations (which is wrong)
let query = Query(resourceType: Organization.self, resourceCollection: university.organizations!)
// This attempts to load GET /universities/1/relationships/organizations (which is right)
let query = Query(resourceType: Organization.self, path: (university.organizations?.linkURL?.relativeString)!)
}
}
}
I am trying to traverse nested relationships and when Query with resourceCollection, the URL being generated is not the one as defined in the relationship: