You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A “relationship object” MUST contain at least one of the following:
links: a links object containing at least one of the following:
self: a link for the relationship itself (a “relationship link”). This link allows the client to directly manipulate the relationship. For example, removing an author through an article’s relationship URL would disconnect the person from the article without deleting the people resource itself. When fetched successfully, this link returns the linkage for the related resources as its primary data. (See Fetching Relationships.)
related: a related resource link
data: resource linkage
meta: a meta object that contains non-standard meta-information about the relationship.
A relationship object that represents a to-many relationship MAY also contain pagination links under the links member, as described below.
It seems meta information like pagination is lost when side-loading resources in a many-to-many relationship. It works correctly in a one-to-many relationship though. According to the spec, it should be possible to serialize this information, although the documentation is vague on how to paginate included resources in a many-to-many-relationship. Custom meta values should not be a problem.
My use case is that I have a list of contractors, and each of them have projects. When I list contractors, I also want to fetch (side load) a small sample of projects (one page), and display how many more there are (the "total" key from the pagination metadata).
GET /contractors?include=projects&fields[projects]=name,cost,image
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 4 weeks if no further activity occurs. Thank you for your contributions.
From the JSON API documentation:
It seems meta information like pagination is lost when side-loading resources in a many-to-many relationship. It works correctly in a one-to-many relationship though. According to the spec, it should be possible to serialize this information, although the documentation is vague on how to paginate included resources in a many-to-many-relationship. Custom meta values should not be a problem.
My use case is that I have a list of contractors, and each of them have projects. When I list contractors, I also want to fetch (side load) a small sample of projects (one page), and display how many more there are (the "total" key from the pagination metadata).
The text was updated successfully, but these errors were encountered: