guardian / facia-scala-client

Low level client for the Facia JSON API
Other
2 stars 1 forks source link

Convert apiquery to backfill #135

Closed piuccio closed 8 years ago

piuccio commented 8 years ago

Backfill is now an object with type and query. This allows future extensions to queries that are not backed by capi.

As a first step both apiQuery and backfill are available, the client tries to use backfill first and apiQuery if missing.

There's a change in a public method interface so I've created a new method with a different signature, users of the library have time to migrate.

@janua @DiegoVazquezNanini @davidfurey

piuccio commented 8 years ago

I've update this PR, it now has a BackfillResolver that implements two types of backfill query

I don't think the child collection should inherit the parent's backfill, at least until we solve loops and deduping.

@janua I've added unit tests!

piuccio commented 8 years ago

thanks @janua I've fixed your comments.

I prefer to throw an exception when the backfill is invalid because it's a configuration error, it's something that shouldn't happen. Returning an empty list will silently ignore an invalid state. I've added a test for that

piuccio commented 8 years ago

@janua I've updated the PR with a better (???) backfill resolver

janua commented 8 years ago

Looks good :clap: :+1: