Spraypaint the isomorphic, framework-agnostic Graphiti ORM
Sparse Fieldsets
Use #select()
to limit the fields returned by the server:
/posts?fields[posts]=title,status
When dealing with relationships, it may be easier to pass an object,
where the key is the corresponding JSONAPI type. This will be exactly
what’s sent to the server in ?fields
:
/posts?fields[posts]=title,status&fields[comments]=created_at
Extra Fieldsets
Use #selectExtra()
to explicitly request a field that doesn’t usually
come back (often computationally expensive):
/posts?extra_fields[posts]=highlights,cumulative_ranking
Just like the select
example above, feel free to pass an object
specifying the fields for each relationship.