Sanity checks input to query method