added required support for queries

Opened PR for feedback