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
Copy file name to clipboardExpand all lines: README.md
+15-42Lines changed: 15 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -419,60 +419,33 @@ This option overrides the `jsonapi_serializer_class_name` method.
419
419
420
420
### Sparse fieldsets
421
421
422
-
The JSON:API spec allows to return only [specific fields](http://jsonapi.org/format/#fetching-sparse-fieldsets).
422
+
The JSON:API spec allows to return only [specific fields](http://jsonapi.org/format/#fetching-sparse-fieldsets) from attributes and relationships.
423
423
424
-
For example, if you wanted to return only `title` and `author`fields for `posts` type and `name` field for `users` type, you could write the following code:
424
+
For example, if you wanted to return only the `title`field and `author`relationship link for `posts`:
You could also pass an array of specific fields for given type instead of comma-separated values:
437
+
Sparse fieldsets operate on a per-type basis, so they affect all resources in the response including in compound documents. For example, this will affect both the `posts`type in the primary data and the `users` type in the compound data:
0 commit comments