Spraypaint the isomorphic, framework-agnostic Graphiti ORM

Sparse Fieldsets

Use #select() to limit the fields returned by the server:

Post.select(['title', 'status']).all()


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: ['title', 'status'],
  comments: ['created_at']


Extra Fieldsets

Use #selectExtra() to explicitly request a field that doesn’t usually come back (often computationally expensive):

Post.selectExtra(['highlights', 'cumulative_ranking']).all()


Just like the select example above, feel free to pass an object specifying the fields for each relationship.