How does versioning behave with query methods?

Will Workflow.getVersion methods work with QueryMethods?

Assume this is for Java SDK right?
No it would not work as queries handlers are not invoked within a workflow thread (unlike signals).
When client sends query request you would get error “Called from non workflow or workflow callback thread” which would fail the workflow task. You can change the query handler code to remove
Workflow.getVersion without breaking workflow determinism.