 
 
 # Todo: Cache resources.
-# Todo: Proper URI construction instead of string concatenations.
 
 
 $ = require 'jquery'

    json =
      queries: [name: 'QUERY', expression: query]
      region: region
    uri += "?__json__=#{ encodeURIComponent (JSON.stringify json) }"
    @collection uri, 'variant', {page_number}
    .then ({items, pagination}) ->
      # We only support one query, so we flatten the query results.
      for item in items

    json =
      queries: [name: 'QUERY', expression: query]
      region: region
    @request URI(uri).setQuery '__json__', JSON.stringify(json)
    .then ({variant}) ->
      # We only support one query, so we flatten the query results.
      variant.coverage = variant.annotations.QUERY.coverage
