Queries are a part of tree-sitter, but unfortunately neovim extended those with more predicates and operators, making most nvim-sitter incompatible with tree-sitter API.
For my text editor I had to yank nvim-treesitter queries and rewrite them.
https://github.com/ivanjermakov/hat-tree-sitter