Change select list of embedded resource without changing endpoint URL #3158
-
Currently, I have resource embedding using an endpoint call such as this one:
This returns the results from my polls table, with embedded results from my poll_choices table and within that embedded results from my poll_votes table. It is working. But I expect to be adding more fields to the poll_votes() select list over time, so I tried to make a view poll_votes_view that selects only the needed fields (and I'd be adding more fields to it over time). But the resource embedding is not working - it gives "Could not find a relationship between 'poll_choices' and 'poll_votes_view' in the schema cache". It works only if I do How can I use a view (or any other approach) in this situation so that I can expand the select list of poll_votes without needing to change the endpoint URL? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That's because resource embedding in views require that:
No need to select all the columns, but the |
Beta Was this translation helpful? Give feedback.
That's because resource embedding in views require that:
No need to select all the columns, but the
poll_choices
id must be present. See Foreign Key Joins on Views in the docs.