contentful-userland / contentful.ex

Elixir SDK for the Contentful Delivery API
MIT License
35 stars 30 forks source link

Adds additional query syntax for the CDA #49

Closed floriank closed 4 years ago

floriank commented 4 years ago

After having no time for a while these days and thinking a bit about #38, I decided to put in some work about it.

This will add support for more complex queries as noted by @ryansch, in the form of:

Entries 
|> content_type("my_content_type") 
|> by(id: "my_id", number_of_warthogs: [lt: 42]) # or similar, no clue what offers the most benefits
|> fetch_all

and provide some safeguards around it, e.g. using by without a content_type call is not permitted, etc.

Feedback, as always, is very welcome.

TODO

Out of scope

Somebody create some issues for the ones above please :wink: (will probably do tomorrow)

Fixes #38.

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 1822167b055a772b4c6d481759eee4d9baa79915-PR-49


Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/contentful_delivery/delivery.ex 2 3 66.67%
lib/contentful/query.ex 19 25 76.0%
<!-- Total: 41 48 85.42% -->
Totals Coverage Status
Change from base Build 50ea35dcac6ffacfcfa51f7ce5d8b4e222b16d5c: 11.6%
Covered Lines: 108
Relevant Lines: 136

💛 - Coveralls