CodeQL CLI includes a language server which can be easily set up in coc.nvim by adding the content of this coc-settings.json file to your own configuration file:

    "codeql": {
      "command": "codeql",
      "args": [
      "filetypes": [
      "initializationOptions": {},
      "settings": {}

Given that coc.nvim uses Vim filetype detection system and not file extensions, you need to let Vim know about *.ql files being CodeQL files. One way to do that is to add codeql.vim to ~/.vim/ftdetect:

" Set '.ql' files as CodeQL files.
au BufRead,BufNewFile *.ql set filetype=codeql