Skip Intro »
If you're unfamiliar with JSONAPI, think
"RESTful GraphQL created by Yehuda Katz"
Here's a simple Suite app:
This API now supports Sparse Fieldsets, Sorting, Pagination, statistics, and Filtering. Though we're using
ActiveRecordin these examples, the same patterns apply to ANY ORM or DATASTORE including HTTP calls. Blend SQL and NoSQL in a single request.
ActiveRecordin the browser"
Associations are simple and customizable:
Associations are deep queryable. In other words, you could fetch the Post and only its
activecomments, sorted by
created_atdescending. This applies to your entire graph of data. The server-side code would be nothing more than:
At this point, You may be thinking:
"Is this just a bunch of incomprehensible ruby magic 😬 ?"
No.We're simply parsing the request, removing boilerplate, and supplying sensible defaults because we believe in convention over configuration.
Let's make our filter a prefix query:
From filtering to pagination, these are all just customizable lambdas. You have complete control of the query.
Just as you can Query the full graph of data, you can also Persist the full graph of data in a single request:
All of this is easily validated with end-to-end integration test patterns that ensure backwards-compatibility:
...and automatically documented in Swagger: