This API now supports
Sparse Fieldsets,
Sorting,
Pagination,
statistics, and
Filtering.
Though we're using
ActiveRecord
in these examples, the same patterns
apply to
ANY ORM or DATASTORE
including
HTTP calls.
Blend SQL and NoSQL in a
single
request.
Let's access the API using our
Javascript Client,
which you can think of as
Associations are
deep queryable. In other words,
you could fetch the Post and only its
active comments,
sorted by
created_at descending.
This applies to your
entire graph of data.
The server-side code would be nothing more than:
allow_filter:active
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:
allow_filter:title_prefixdo|scope,value|scope.where(["title LIKE ?","#{value}%"])end
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:
There's
so much more
to talk about. To get your feet wet, check out
our
Quickstart,
or step-by-step
Tutorial.
We also have
comprehensive documentation
on the
Server
and on the
Client.
Join our
Slack Chat
to ask questions or say hi - we'd
love to meet you and hear what you think ❤️