queries: make queries work with flowterp

They are treated in the same way as pipes.